mapserver tif projections

Douglass Davis douglass_davis at EARTHLINK.NET
Thu Jul 28 19:08:41 EDT 2005



Ethan Alpert wrote:

> You should be using the units of the laea projection rather than 
> decimal degrees to set the EXTENT.
>  
> It's very difficult to know from a lat/long box what the output of the 
> projection will be. It's best to use the units of the projected 
> coordinate system.
>  
> -e 

Thanks.  That worked....  For all the other newbies, and since this was 
so confusing to me, I thought I would post the solution for people to 
google later.

My previous extent was in lat/lon
EXTENT -85 32 -75 3

Since I just wanted the North Carolina area, so I used the cs2cs 
conversion program to convert from Lat Lon to Lambert Azimuthal Equal 
Area Projection coordinates.

C:\mapserver\data>cs2cs +proj=latlong +datum=WGS84 +to +proj=laea 
+ellps=clrk66
+lat_0=45 +lon_0=-100
-85 32  <---type lower left coords here
1417368.72      -1316195.76 0.000 
-75 38  <--- type upper right coords here
2159115.16      -450114.08 0.000

New extent is
  EXTENT 1417368.72  -1316195.76 2159115.16 -450114.08

# Projection (global, in Map object)
  PROJECTION
    # Projection parameters can be defined in two ways...
    # This is the traditional Proj.4 definition of Lambert Azimuthal 
Equal-Area
    # projection for the Continental U.S.
      "proj=laea"
      "ellps=clrk66"
      "lat_0=45"
      "lon_0=-100"
  END

# My tif layer:
 LAYER
   NAME         elevation
   DATA         "elevation/05539624.tif"
   TYPE         RASTER
   STATUS       ON
 END

# Another layer with the a projection:

  LAYER
     NAME counties
     DATA "counties/co37_d00"
     TYPE POLYGON
     STATUS ON
     CLASSITEM "STATE"
     CLASS
        NAME counties
       EXPRESSION "37"
        STYLE
          COLOR -1 -1 -1
          OUTLINECOLOR 5 5 5
        END
     END
    PROJECTION
      "init=epsg:4326"
    END
  END


--
PHP Stuff:
http://www.douglassdavis.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050728/3f4420d6/attachment.html


More information about the mapserver-users mailing list