Projection Issues

bill at BINKO.NET bill at BINKO.NET
Fri Mar 25 16:09:09 PST 2005


Hello everyone,

I am using Mapserver 4.4.1 to display data from shapefiles and postGIS.

I have been thrilled with how fast I have gotten everything going, and I
actually think I understand projections better thanks to recent posts on
this list -- thanks!

However, I am failing to get projections to work (at all).  This is very
frustrating, since I actually thought I knew what I was doing :)

I have Proj4 compiled in:

MapServer version 4.4.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ
SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=TIFF INPUT=EPPL7 INPUT=JPEG
INPUT=POSTGIS INPUT=SHAPEFILE

I have two data sources: the county, and the state.  The county uses this
projection (from their shapefiles):

PROJCS["NAD27 Florida State Planes, Western Zone, US Foot",
GEOGCS["North_American_Datum_1927",DATUM["D_North_American_1927",
SPHEROID["Clarke - 1866",6378206.4,294.9786982139006]],
PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",24.3333333333333],
PARAMETER["central_meridian",-82],
PARAMETER["scale_factor",0.9999411765],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],UNIT["Foot_US",0.30480

I looked in the postGIS spatial_ref_system table, and found that the SRID
for that is 26759. The Proj4 parameters in that table are:

+proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941
+x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27
+to_meter=0.3048006096012192 +no_defs

I want that to be my output projection (if that's foolish, please let me
know, but since all of my maps are at the county level, it seemed to make
sense).  So, I put that as the PROJECTION block in the MAP section:

        PROJECTION
                "proj=tmerc"
                "lat_0=24.33333333333333"
                "lon_0=-82"
                "k=0.999941"
                "x_0=152400.3048006096"
                "y_0=0"
                "ellps=clrk66"
                "datum=NAD27"
                "to_meter=0.3048006096012192"
                "no_defs"
        END

The other data I want to show (right now) is from the state, which uses
this projection (from its shape file)

PROJCS["NAD_1983_UTM_Zone_17N",GEOGCS["GCS_North_American_1983",DATUM["D_North_A
merican_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0
.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMET
ER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_
Meridian",-81.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin"
,0.0],UNIT["Meter",1.0]]

Lookint in the PostGIS table again, I find an SRID of 26917 with proj4
codes of:
+proj=utm +zone=17 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

So I put that in the PROJECTION block of the state's LAYER section:
                        PROJECTION
                                "proj=utm"
                                "zone=17"
                                "ellps=GRS80"
                                "datum=NAD83"
                                "units=m"
                                "no_defs"
                        END
The problem is that it simply doesn't show that layer!  If I make a new
mapfile with just that layer, and no projections, it draws it (it's a set
of roads), so I know the data is valid.  However, I can't seem to get the
two projections on one map.

Any help would be appreciated!

Thanks
Bill

bill at binko.net



More information about the MapServer-users mailing list