[Mapserver-users] Ccoordinate/projection display problem?

Ed McNierney ed at topozone.com
Fri Sep 12 14:00:45 EDT 2003


Ann -

You need to specify a PROJECTION block for your MAP object (at the top level) as you have, AND you need to specify a PROJECTION block inside each layer with a source in a projection different than the output map.  The example below has PROJECTION blocks in the right places, but you're not specifying that raster layer is in UTM - you're saying that the output map, the shapefile, and the raster layer are all in the same lat/lon projection.

Your EXTENT also needs to be in the same units as the top-level (output) projection, so it should be in degrees for lat/lon and meters for UTM; you should also add a UNITS DD or UNITS METERS as appropriate to avoid problems with scalebars, etc.

	- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242 

-----Original Message-----
From: Ann Keane [mailto:Ann.Keane at noaa.gov]
Sent: Friday, September 12, 2003 1:20 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Ccoordinate/projection display problem?


The short description:

I have two layers, one geotiff, one shape.  The geotiff, a shaded relief 
base map, appears to be in UTM.  The shape, a file of state boundaries, 
appears to be in latlon.  I think I have proj installed properly, but 
I've thought that before.  I've tried many variations of the map file 
with either the shp projection or the raster projection.

In raster projection:
	Raster plots, shape does not.

In shp projection:
	Shape plots, if it is the only layer.
	Plot is totally grey if both layers are included.


Also using the epsg specification instead of the detail never works. 
Would anyone suggest a way to test the proj installation outside of 
mapserver?

Thanks-
Ann


The details:

mapserver
----------------------------------------------
[akeane at pinky ]$ ./mapserv -v
MapServer version 4.0 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ 
SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT 
SUPPORTS=WFS_SERVER INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE


----------------------------------------------
map file
----------------------------------------------
NAME TEST
#EXTENT -84.0 36.0 -59.0 49.0 # shp extent
# EXTENT -6086629.000 -2784239.000 4279371.000 4488761.000 # full raster 
extent
EXTENT -6629.000 -1084239.000 3079371.000 988761.000 # local raster extent
SIZE 400 300
SHAPEPATH "/httpd/www/programs/2004/neaqs/surface/dyn/data"
DEBUG on

WEB
     LOG "/httpd/www/programs/2004/neaqs/surface/dyn/out.log"
END

#PROJECTION
#   # shp projection
#   "proj=latlong"
#END

PROJECTION
     # raster projection
#    "epsg:4326"
     "proj=longlat"
     "ellps=WGS84"
     "datum=WGS84"
     "no_defs"
END

LAYER # States
   NAME "states"
# source http://nationalatlas.gov/statesm.html
   DATA statesp020
   STATUS DEFAULT
   TYPE POLYGON
  CLASS
     COLOR 220 220 220
     OUTLINECOLOR 255 0 0
   END # end of class object
DEBUG on

PROJECTION
     "proj=latlong"
END


END # end of layer object


LAYER # Shaded Relief Raster
   NAME "relief"
# source http://nationalatlas.gov/shadedm.html
   DATA "/httpd/www/programs/2004/neaqs/surface/dyn/data/shdrlfi020l.tif"
   STATUS DEFAULT
   TYPE RASTER
DEBUG on

PROJECTION
#    "epsg:4326"
     "proj=longlat"
     "ellps=WGS84"
     "datum=WGS84"
     "no_defs"
END

END

-------------------------------------------------------
Raster file
-------------------------------------------------------

[akeane at pinky data]$ gdalinfo shdrlfi020l.tif
Driver: GTiff/GeoTIFF
Size is 10366, 7273
Coordinate System is:
PROJCS["unnamed",
     GEOGCS["WGS 84",
         DATUM["WGS_1984",
             SPHEROID["WGS 84",6378137,298.2572235629972,
                 AUTHORITY["EPSG","7030"]],
             AUTHORITY["EPSG","6326"]],
         PRIMEM["Greenwich",0],
         UNIT["degree",0.0174532925199433],
         AUTHORITY["EPSG","4326"]],
     PROJECTION["Lambert_Azimuthal_Equal_Area"],
     PARAMETER["latitude_of_center",45],
     PARAMETER["longitude_of_center",-100],
     PARAMETER["false_easting",0],
     PARAMETER["false_northing",0],
     UNIT["metre",1,
         AUTHORITY["EPSG","9001"]]]
Origin = (-6086629.000000,4488761.000000)
Pixel Size = (1000.000000,-1000.000000)
Metadata:
   TIFFTAG_IMAGEDESCRIPTION=Color shaded relief of North America
   TIFFTAG_SOFTWARE=USGS DRG production software
   TIFFTAG_DATETIME=2003:02:06 13:19:34
Corner Coordinates:
Upper Left  (-6086629.000, 4488761.000) (156d 3'31.10"E, 37d45'55.65"N)
Lower Left  (-6086629.000,-2784239.000) (154d27'44.36"W,  3d 2'12.16"N)
Upper Right ( 4279371.000, 4488761.000) (  4d 0'23.08"W, 53d59'22.66"N)
Lower Right ( 4279371.000,-2784239.000) ( 61d 9'32.19"W, 11d18'12.56"N)
Center      ( -903629.000,  852261.000) (113d12'19.80"W, 51d59'8.84"N)
Band 1 Block=10366x1 Type=Byte, ColorInterp=Red
Band 2 Block=10366x1 Type=Byte, ColorInterp=Green
Band 3 Block=10366x1 Type=Byte, ColorInterp=Blue


---------------------------------------------------
shp file
---------------------------------------------------
[akeane at pinky data]$ ogrinfo statesp020.shp statesp020 | more
INFO: Open of `statesp020.shp'
using driver `ESRI Shapefile' successful.

Layer name: statesp020
Geometry: Polygon
Feature Count: 2895
Extent: (-179.133392, 17.674692) - (179.788208, 71.398048)
Layer SRS WKT:
(unknown)
AREA: Real (12.3)
PERIMETER: Real (12.3)
STATESP020: Integer (11.0)
STATE: String (20.0)
STATE_FIPS: String (2.0)
OGRFeature(statesp020):0

---------------------------------------------------
shp metadata
---------------------------------------------------

Spatial_Reference_Information:

     Horizontal_Coordinate_System_Definition:

         Geographic:

             Latitude_Resolution: 0.000278
             Longitude_Resolution: 0.000278
             Geographic_Coordinate_Units: Decimal degrees

         Geodetic_Model:

             Horizontal_Datum_Name: North American Datum of 1983
             Ellipsoid_Name: GRS1980
             Semi-major_Axis: 6378137
             Denominator_of_Flattening_Ratio: 298.257222


_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list