[mapserver-users] hints wanted
Matthew Hatcher
MJHatcher@space.qinetiq.com
Wed, 21 Aug 2002 13:41:50 +0100
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C24910.1EFB5F50
Content-Type: text/plain; charset="ISO-8859-1"
Marian,
Good news: Mapserver can do what you want!
Shapefiles are vector data - point, line and polygon co-ordinates. They are
different from rasters (images - like JPGs) so they are not essential.
What you need to create is a 'world file' for each of your JPGS to reference
it your chosen co-ordinate system. World files are described in the
Mapserver HOWTO for rasters, but basically use:
X pixel size in your co-ordinate system
0.0
0.0
Y pixel size in your co-ordinate system (usually minus if the origin is
top-left)
X co-ordinate of top-left
Y co-ordinate of top-left
So if your map top-left is at 100,100 in your co-ordinates and each pixel
represents 5 meters then use:
5.0
0.0
0.0
-5.0
100.0
100.0
Create this as a text file - just those six lines - and save it with the
same filename as the JPG but a .WLD or .JGW extension.
Then use a very simple map file like the one below. You could add 'MINSCALE'
and 'MAXSCALE' properties if you want to set one or other so they only
appear at a given scale, perhaps.
I hope this gives you some pointers. Good luck with Mapserver!
Matt Hatcher.
---- map.map ----
NAME MAP
STATUS ON
SIZE 600 350 # set size of output image
UNITS METERS
SHAPEPATH "data"
IMAGECOLOR 255 255 255 # set background colour of image
IMAGETYPE jpeg
IMAGEQUALITY 100 # only appropriate for jpeg
output
#
# Projection definition
#
PROJECTION
"init=epsg:4326" # set this to whatever,
maybe just 'geographic'
END
#
# Start of web interface definition
#
WEB
TEMPLATE template.html
IMAGEPATH "d:\Inetpub\wwwroot\tmp\"
IMAGEURL "/tmp/"
METADATA
WMS_TITLE "title"
WMS_ABSTRACT "abstract"
WMS_ACCESSCONSTRAINTS none
# change this value to match your setup
WMS_ONLINERESOURCE "http://localhost"
WMS_SRS "EPSG:4326"
END
END
#
# Layers
#
LAYER
NAME "map1"
TYPE RASTER
STATUS OFF
DATA "map1.jpg"
CLASS
NAME "Map1"
END
END
LAYER
NAME "map2"
TYPE RASTER
STATUS OFF
DATA "map2.jpg"
CLASS
NAME "Map2"
END
END # Map File
-----Original Message-----
From: Marian Grigoras [mailto:marian.grigoras@mchp.siemens.de]
Sent: 21 August 2002 10:01
To: mapserver-users@lists.gis.umn.edu
Subject: [mapserver-users] hints wanted
Hello,
I am a new user of MapServer. I managed to run the demo and made a few
easy programs by myself using the tutorial data.
I want to configure a very simple map server that uses JPG (GIF or other
image file), but I do not have the maps in shapefile format. I only need
to specify they position relative to one another, or relative to a
general coordinate system, no matter which one it is (what I mean is
that I need the map server running on a campus level, so I do not care
for global lat/lon coordinates or similar). Basically I would like to be
able to toggle between 2 maps (JPGs) according to the zoom level and do
some cropping on the selected map.
MapServer looks great, but (there had to be a BUT :-) ) unfortunately I
do not have time to invest 1 week in parsing the tutorial and the whole
documentation just to find out that MapServer cannot handle this case
(in 1 week I could write a small server by my own).
So could someone more experienced:
- at least tell me if MapServer could handle my application,
- at most :-) give some hints on the easiest way to implement this
(REFERENCE maps or something else)
Sorry if this looks trivial, but I need some information fast.
Thanks a lot.
Marian Grigoras
**********************************************************************
The information contained in this email and any subsequent
correspondence is private and is intended solely for the
intended recipient(s). For those other than the intended
recipient(s) any disclosure, copying, distribution, or any
action taken or omitted to be taken in reliance on such
information is prohibited and may be unlawful.
**********************************************************************
------_=_NextPart_001_01C24910.1EFB5F50
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3DISO-8859-=
1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [mapserver-users] hints wanted</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>Marian,</FONT>
</P>
<P><FONT SIZE=3D2>Good news: Mapserver can do what you want!</FONT>
</P>
<P><FONT SIZE=3D2>Shapefiles are vector data - point, line and polygon co-o=
rdinates. They are different from rasters (images - like JPGs) so they are =
not essential.</FONT></P>
<P><FONT SIZE=3D2>What you need to create is a 'world file' for each of you=
r JPGS to reference it your chosen co-ordinate system. World files are desc=
ribed in the Mapserver HOWTO for rasters, but basically use:</FONT></P>
<P><FONT SIZE=3D2>X pixel size in your co-ordinate system</FONT>
<BR><FONT SIZE=3D2>0.0</FONT>
<BR><FONT SIZE=3D2>0.0</FONT>
<BR><FONT SIZE=3D2>Y pixel size in your co-ordinate system (usually minus i=
f the origin is top-left)</FONT>
<BR><FONT SIZE=3D2>X co-ordinate of top-left</FONT>
<BR><FONT SIZE=3D2>Y co-ordinate of top-left</FONT>
</P>
<P><FONT SIZE=3D2>So if your map top-left is at 100,100 in your co-ordinate=
s and each pixel represents 5 meters then use:</FONT>
</P>
<P><FONT SIZE=3D2>5.0</FONT>
<BR><FONT SIZE=3D2>0.0</FONT>
<BR><FONT SIZE=3D2>0.0</FONT>
<BR><FONT SIZE=3D2>-5.0</FONT>
<BR><FONT SIZE=3D2>100.0</FONT>
<BR><FONT SIZE=3D2>100.0</FONT>
</P>
<P><FONT SIZE=3D2>Create this as a text file - just those six lines - and s=
ave it with the same filename as the JPG but a .WLD or .JGW extension.</FON=
T></P>
<P><FONT SIZE=3D2>Then use a very simple map file like the one below. You c=
ould add 'MINSCALE' and 'MAXSCALE' properties if you want to set one or oth=
er so they only appear at a given scale, perhaps.</FONT></P>
<P><FONT SIZE=3D2>I hope this gives you some pointers. Good luck with Mapse=
rver!</FONT>
</P>
<P><FONT SIZE=3D2>Matt Hatcher.</FONT>
</P>
<P><FONT SIZE=3D2>---- map.map ----</FONT>
<BR><FONT SIZE=3D2>NAME MAP</FONT>
<BR><FONT SIZE=3D2>STATUS ON</FONT>
<BR><FONT SIZE=3D2>SIZE 600 350 &=
nbsp; &n=
bsp; # s=
et size of output image</FONT>
<BR><FONT SIZE=3D2>UNITS METERS</FONT>
<BR><FONT SIZE=3D2>SHAPEPATH "data"</FONT>
<BR><FONT SIZE=3D2>IMAGECOLOR 255 255 255 &nb=
sp; # set background=
colour of image</FONT>
<BR><FONT SIZE=3D2>IMAGETYPE jpeg</FONT>
<BR><FONT SIZE=3D2>IMAGEQUALITY 100 &nbs=
p;  =
; # only appropriate=
for jpeg output</FONT>
</P>
<P><FONT SIZE=3D2>#</FONT>
<BR><FONT SIZE=3D2># Projection definition</FONT>
<BR><FONT SIZE=3D2>#</FONT>
<BR><FONT SIZE=3D2>PROJECTION</FONT>
<BR><FONT SIZE=3D2> "init=3Depsg:4326" &nb=
sp; &nbs=
p; # set this =
to whatever, maybe just 'geographic'</FONT>
<BR><FONT SIZE=3D2>END</FONT>
</P>
<P><FONT SIZE=3D2>#</FONT>
<BR><FONT SIZE=3D2># Start of web interface definition</FONT>
<BR><FONT SIZE=3D2>#</FONT>
<BR><FONT SIZE=3D2>WEB</FONT>
<BR><FONT SIZE=3D2> TEMPLATE template.html</FONT>
<BR><FONT SIZE=3D2> IMAGEPATH "d:\Inetpub\wwwroot\tmp\"</FO=
NT>
<BR><FONT SIZE=3D2> IMAGEURL "/tmp/"</FONT>
<BR><FONT SIZE=3D2> METADATA</FONT>
<BR><FONT SIZE=3D2> WMS_TITLE "title"</FONT>
<BR><FONT SIZE=3D2> WMS_ABSTRACT "abstract"</FO=
NT>
<BR><FONT SIZE=3D2> WMS_ACCESSCONSTRAINTS none</FONT>
</P>
<P><FONT SIZE=3D2> # change this value to match your setu=
p</FONT>
<BR><FONT SIZE=3D2> WMS_ONLINERESOURCE "<A HREF=3D"h=
ttp://localhost" TARGET=3D"_blank">http://localhost</A>"</FONT>
</P>
<P><FONT SIZE=3D2> WMS_SRS "EPSG:4326"</FONT>
<BR><FONT SIZE=3D2> END</FONT>
<BR><FONT SIZE=3D2>END</FONT>
</P>
<P><FONT SIZE=3D2>#</FONT>
<BR><FONT SIZE=3D2># Layers</FONT>
<BR><FONT SIZE=3D2>#</FONT>
<BR><FONT SIZE=3D2>LAYER</FONT>
<BR><FONT SIZE=3D2> NAME "map1"</FONT>
<BR><FONT SIZE=3D2> TYPE RASTER</FONT>
<BR><FONT SIZE=3D2> STATUS OFF</FONT>
<BR><FONT SIZE=3D2> DATA "map1.jpg"</FONT>
</P>
<P><FONT SIZE=3D2> CLASS</FONT>
<BR><FONT SIZE=3D2> NAME "Map1"</FONT>
<BR><FONT SIZE=3D2> END</FONT>
</P>
<P><FONT SIZE=3D2>END</FONT>
</P>
<P><FONT SIZE=3D2>LAYER</FONT>
<BR><FONT SIZE=3D2> NAME "map2"</FONT>
<BR><FONT SIZE=3D2> TYPE RASTER</FONT>
<BR><FONT SIZE=3D2> STATUS OFF</FONT>
<BR><FONT SIZE=3D2> DATA "map2.jpg"</FONT>
</P>
<P><FONT SIZE=3D2> CLASS</FONT>
<BR><FONT SIZE=3D2> NAME "Map2"</FONT>
<BR><FONT SIZE=3D2> END</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>END # Map File</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Marian Grigoras [<A HREF=3D"mailto:marian.grigoras=
@mchp.siemens.de">mailto:marian.grigoras@mchp.siemens.de</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: 21 August 2002 10:01</FONT>
<BR><FONT SIZE=3D2>To: mapserver-users@lists.gis.umn.edu</FONT>
<BR><FONT SIZE=3D2>Subject: [mapserver-users] hints wanted</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Hello,</FONT>
</P>
<P><FONT SIZE=3D2>I am a new user of MapServer. I managed to run the demo a=
nd made a few</FONT>
<BR><FONT SIZE=3D2>easy programs by myself using the tutorial data.</FONT>
<BR><FONT SIZE=3D2>I want to configure a very simple map server that uses J=
PG (GIF or other</FONT>
<BR><FONT SIZE=3D2>image file), but I do not have the maps in shapefile for=
mat. I only need</FONT>
<BR><FONT SIZE=3D2>to specify they position relative to one another, or rel=
ative to a</FONT>
<BR><FONT SIZE=3D2>general coordinate system, no matter which one it is (wh=
at I mean is</FONT>
<BR><FONT SIZE=3D2>that I need the map server running on a campus level, so=
I do not care</FONT>
<BR><FONT SIZE=3D2>for global lat/lon coordinates or similar). Basically I =
would like to be</FONT>
<BR><FONT SIZE=3D2>able to toggle between 2 maps (JPGs) according to the zo=
om level and do</FONT>
<BR><FONT SIZE=3D2>some cropping on the selected map.</FONT>
<BR><FONT SIZE=3D2>MapServer looks great, but (there had to be a BUT :-) ) =
unfortunately I</FONT>
<BR><FONT SIZE=3D2>do not have time to invest 1 week in parsing the tutoria=
l and the whole</FONT>
<BR><FONT SIZE=3D2>documentation just to find out that MapServer cannot han=
dle this case</FONT>
<BR><FONT SIZE=3D2>(in 1 week I could write a small server by my own).</FON=
T>
<BR><FONT SIZE=3D2>So could someone more experienced:</FONT>
<BR><FONT SIZE=3D2>- at least tell me if MapServer could handle my applicat=
ion,</FONT>
<BR><FONT SIZE=3D2>- at most :-) give some hints on the easiest way to impl=
ement this</FONT>
<BR><FONT SIZE=3D2>(REFERENCE maps or something else)</FONT>
</P>
<P><FONT SIZE=3D2>Sorry if this looks trivial, but I need some information =
fast.</FONT>
<BR><FONT SIZE=3D2>Thanks a lot.</FONT>
</P>
<P><FONT SIZE=3D2>Marian Grigoras</FONT>
</P>
<CODE><FONT SIZE=3D3><BR>
<BR>
**********************************************************************<BR>
The information contained in this email and any subsequent<BR>
correspondence is private and is intended solely for the <BR>
intended recipient(s). For those other than the intended<BR>
recipient(s) any disclosure, copying, distribution, or any <BR>
action taken or omitted to be taken in reliance on such <BR>
information is prohibited and may be unlawful.<BR>
**********************************************************************<BR>
</FONT></CODE>
</BODY>
</HTML>
------_=_NextPart_001_01C24910.1EFB5F50--