Raster layer coordinates

Frank Warmerdam fwarmerdam at GMAIL.COM
Mon Aug 1 10:26:59 EDT 2005


On 8/1/05, Y. Calcagni <yvan.calcagni at voila.fr> wrote:
> Hi everybody!!!
> 
> I've searched for days how to get the extent of a raster layer but I didn't
> succeed... I just want to make a short function which can permit user to
> recenter the map to any layer extent in the mapfile. It already works fine
> with vector layers. If anyone has ideas....

Yvan,

I am not aware of any mapscript call to get the extents of a raster layer.
In fact, for WMS or normal CGI use MapServer has essentially no 
mechanisms to query layout information from a raster layer.  All it can
do is ask them to draw themselves.  

If you are working in Python you can import "gdal" and use it to get
geometry information.   Otherwise you might want to add extents metadata
on the layer in the .map file (either manually, or with some other sort of
script) and then fetch from that.  

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