[Mapserver-users] Extent and units

Frank Warmerdam warmerdam at pobox.com
Mon Mar 22 13:49:32 EST 2004


Tony Jolibois wrote:
>         Hi all,
> 
> I don't understand the extent of the data in the demo of the mapserver :
> 
>     * in the map file : EXTENT
> 
> 201621.496941 -294488.285333
> 1425518.020722
> 498254.511514
> 
>     * the same data with ogrinfo : -97.238976 41.619778 -82.122902
>       49.385620 
> 
> The 1rst are in meter and the second in degrees, how do you pass from 
> the 2nd to the first ?
> Can't we define the EXTENT with decimal degrees in the mapfile ?

Tony,

My assumption would be that the underlying data layer (as reported by ogrinfo)
is in geographic coordinates while the map has a PROJECTION declaration for the
map display forcing it to some projected coordinate system.  The extent would
then be in whatever coordinate system the map is defined in.  In cases like this
MapServer automatically takes care of reproject between the layer coordinate
system and map coordinate system as long as everything is declared properly.

You could either take the geographic bounds and reproject them to the target
coordinate system to set the EXTENT line, or if you really want your resulting
map to be sampled on a geographic grid you could reset the map level
PROJECTION definition to be geographic.  You might find you also need to
change the UNITS declaration to DD (decimal degrees).

It might be helpful if you supplied your .map file or at least the portions
dealing with the layer in quetion and map level settings.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the mapserver-users mailing list