map projection question from a newbie
Stephen Woodbridge
woodbri at SWOODBRIDGE.COM
Thu Sep 22 05:09:10 PDT 2005
Hi James,
You are doing nothing wrong. Mapserver takes the coordinate in the file
and treats them as X/Y and generates the images based on this. If you
plot geographic long/lat as X/Y you get an elongated image. xastir must
be compensating for the fact that it is geographic data and applying a
hidden projection of some type.
Mapserver does not do this. if you want it projected you have to
EXPLICITLY tell it to perform a projection.
In the mapfile, you can define the OUTPUT projection in the MAP object
and the projection that the data is in in the LAYER object, or you can
leave all the PROJECT ... END blocks out if they are all the same and it
will just plot the data as X/Y.
-Steve W.
James Washer wrote:
> I'm a newbie to mapping in general, so please have mercy if I'm asking stupid questions.
>
> I have a shapefile that was given to me in Nevada State Plane, and I used shpproj to reproject as follows:
> shpproj stateplane_shapefile geographic_shapefile -i="init=nad83:2703 units=us-ft" -o=geographic
>
> The map looks perfect when I view it in xastir (ham radio APRS mapping program) but looks about 30% too wide when viewed with mapserver.
>
> Here's the map file... Any ideas what I'm doing wrong?
>
> thanks for reading this far.
>
> - jim
>
> MAP
> IMAGETYPE PNG
> #EXTENT -119.961409 38.535114 -119.310436 39.113979
> EXTENT -120.0 38.535114 -119.25 39.113979
>
> SIZE 600 600
> SHAPEPATH "/usr/local/share/xastir/maps/Douglas/Parcels"
> #SHAPEPATH "/var/www/html/gis/Douglas/Parcels"
> IMAGECOLOR 200 200 200
>
> WEB
> TEMPLATE doug2-1.html
> IMAGEPATH "/var/www/html/gis/tmp/"
> IMAGEURL "/gis/tmp/"
> END
>
> LEGEND
> STATUS EMBED
> POSITION LR
> #TRANSPARENT TRUE
> END
>
> UNITS DD
>
>
> PROJECTION
> "proj=latlong"
> "ellps=WGS84"
> END
>
>
>
> SCALEBAR
> STATUS EMBED
> UNITS MILES
> INTERVALS 3
> OUTLINECOLOR 0 0 0
> END
>
> LAYER # States polygon layer begins here
> NAME Parcels
> DATA dc_pcls1
> STATUS DEFAULT
> TYPE POLYGON
> LABELITEM TAG
> #CLASS
> #NAME "TAG"
> #EXPRESSION
>
> CLASS
> NAME "Douglas County Parcels"
> STYLE
> COLOR 232 232 232
> OUTLINECOLOR 32 32 32
> END
> LABEL
> SIZE LARGE
> MINFEATURESIZE 200
> END
> END
> END
>
> END
>
More information about the MapServer-users
mailing list