[mapserver-users] hints wanted

Matthew Hatcher MJHatcher at space.qinetiq.com
Wed Aug 21 08:41:50 EDT 2002


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 at mchp.siemens.de]
Sent: 21 August 2002 10:01
To: mapserver-users at 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.
**********************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020821/b1a715e9/attachment.html


More information about the mapserver-users mailing list