[Mapserver-users] A few Mapserv questions

Richard Greenwood rich at greenwoodmap.com
Sat Jan 31 23:41:34 PST 2004


James Mclean wrote:

> Hi All,
>
> I have worked through the Tutorial on getting mapserver 4.0 to work, 
> but after the first tutorial I have some questions...
>
> Please bear in mind that I am new to this GIS type stuff, its like 
> learning french to me. Im a programmer, not a GIS guy :)
>
> I have created a basic .map as outlined in the tutorial, and after 
> working through some problems because of a missing PROJ library, I 
> have a working mapserv binary.
>
> The basic map file I am using (test.map) is as below... A direct copy 
> and paste from the tuit, with the nesicerry changes.
>
> MAP
>   IMAGETYPE PNG
>   EXTENT 254184.15504499 6174213.6411365 314868.3598851 6210501.3473782
>   SIZE 400 300
>   SHAPEPATH "/home/jamesmc/asm2.air-stream.org/maps/i5409/"
>   IMAGECOLOR 255 255 255
>
>   PROJECTION
>     "proj=laea"
>     "ellps=clrk66"
>     "lat_0=45"
>     "lon_0=-100"
>   #
>   # Alternatively, you can specify an EPSG code.
>   # "init=epsg:2163"
>   #
>   END
>
>   # Start of LAYER DEFINITIONS 
> ---------------------------------------------
>   LAYER # States polygon layer begins here
>     NAME states
>     DATA i5409t_r
>     STATUS DEFAULT
>     TYPE POLYGON
>
>     PROJECTION
>       "init=epsg:4269"
>     END
>
>     CLASS
>       COLOR 232 232 232
>       OUTLINECOLOR 32 32 32
>     END
>   END # States polygon layer ends here
>   # End of LAYER DEFINITIONS -------------------------------
> END # end of map file/object
>
> First question is, the EXTENT paramerter in the map file. What exactly 
> are the numbers ment to be? The tuit says 'Meters', so I assume that 
> means Easting, Northing, but what are the last two?

The extent is the coordinates that define the bounding box of your data, 
or area of interest as minx, miny, maxx, maxy, or west, south, east, 
north bounds. This may bi in linear units (meters, feet, etc.) or 
angular units (degrees of latitude and longitude). They must correspond 
to your data. Read the docs 
http://mapserver.gis.umn.edu/doc40/mapfile-reference.html#map

> How can I tell what format my maps use?

That can be hard. Ideally the data comes with a statement saying what 
coordinate system and units the data is in. I see your data includes 
.prj files, which define the coordinate system, so run gdalinfo.exe 
foo.shp and it will give you  coordinate info.

>
> Second question is, I have my SHAPEPATH set correctly (I presume), the 
> directory has 242 files with the extensions .dbf, .prj, .shp, .shx. I 
> assume these are the ERSI Shapefiles I need to reference?

Yes. a "shape" file is a collection of files having the same name, but  
a different extensions. The .shp contains the spatial info (geometry) 
The .dbf is just a standard dBase file. The .prj defines the coordinate 
system.

>
> The data I downloaded was 1:250K Australian maps, in the MapInfo 
> Shapefile format.

MapInfo files are not shape files. MapInfo files are a similar group of 
files, that as a minimum include a .tab file. Althought MapInfo data 
format is supported in mapserver via OGR, stick with the shape files if 
they are available.

>
> In the LAYER section, I have 'DATA i5409t_r', but i5409t_r is just one 
> file. What if the data I want is not in that particular file? How do I 
> know what is in each file? 

Grab a free viewer off the ESRI site, or off the freegis site. You can 
quickly view each file, and also see the coordinates.

-- 
Richard Greenwood
www.greenwoodmap.com




More information about the MapServer-users mailing list