[Mapserver-users] projection issues

Leah Roderman lsroderman at gmail.com
Thu Jun 3 19:53:09 EDT 2004


I always tangle with projection issues and then forget my solutions.

Problem: My coordinates are misaligned with my TIGER shapefiles.

The long explanation: I am using TIGER '90 polygons and line features.
Atop these, I am displaying points used by taking GPS readings, saving
them in Postgres, and retrieving them via PostGIS.

The points I have mapped are consistently and slightly off where they
should be on the map.  I have also noticed that coordinates I have
obtained via maporama.com also have the same problem. The offset ratio
is the same regardless of what zoom the map is in or the source of the
coords.

I decided it is unlikely TIGER is incorrect, and more likely I have a
projection problem, meaning that I am not projecting the TIGER data to
the same system as my coordinates.

The thing is, no matter how I fuss with my projection object (setting
at map level, setting at layer level), I don't see any changes. If I
remove the projection altogether, I see nothing change.

Configuration: Basic CGI mapserver, running on Linux RedHat 9.2,
PostgreSQL 7.3.2, 0.8.1, PROJ-4.4.7.

MapServer version 4.0.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=EPPL7
INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

I am collecting GPS data using a Garmin etrex Vista. The export file I
generate for coordinates includes "Datum   WGS 84" at top. My
understanding of TIGER is that it is not in any projection (based on
http://www.census.gov/geo/www/tlmetadata/metadata.html).

The map can be viewed at
http://www.oaklandarttrust.com/cgi-bin/mapserv?map=alameda.map&mode=browse&layer=artwork&layer=city_names.

The map file continues to grow, but an excerpt is here with some
examples (note I've experimented with projection reference to epsg and
by specifying):

...

# extent determined using ogrinfo
EXTENT -122.341625 37.663501 -122.087752 37.917356
SHAPEPATH "/home/arttrust/oaklandarttrust.com/web/artmap/data"
IMAGECOLOR 183 201 230
SYMBOLSET "oakland.sym"
FONTSET "/home/arttrust/oaklandarttrust.com/web/artmap/fonts/fonts.list"
UNITS dd
# UTM N10
PROJECTION
 "init=epsg:32610"
END

...

LAYER
  NAME "Alameda County"
  DATA tgr06001cty00
  STATUS DEFAULT
  TYPE POLYGON
  PROJECTION
    "proj=utm"
    "ellps=WGS84"
    "zone=10"
    "north"
    "no_defs"
  END
  CLASSITEM "COUNTY"
  CLASS
    NAME "Alameda County"
    EXPRESSION /./
    COLOR 171 186 173
  END # class
END # layer

...

Lastly, proj works fine when invoked from command line e.g.

# proj -V +proj=aea +ellps=WGS84 +datum=NAD27 +lon_0=-120.0000
+lat_0=0 +lat_1=34.
#Albers Equal Area
#       Conic Sph&Ell
#       lat_1= lat_2=
# +proj=aea +ellps=WGS84 +datum=NAD27 +lon_0=-120.0000 +lat_0=0 +lat_1=34.

[etc.]
...

Thanks for any advice that might help with debugging!



More information about the mapserver-users mailing list