Opened 22 years ago

Closed 15 years ago

Last modified 15 years ago

#79 closed enhancement (fixed)

WMS - Support GetExtents() for rasters

Reported by: dmorissette Owned by: warmerdam
Priority: normal Milestone: 6.0 release
Component: WMS Server Version: 4.1
Severity: minor Keywords: raster extent
Cc: mapserver@…, jmckenna

Description (last modified by dmorissette)

In the current version of MapServer, extents for rasters in the WMS capabilities have to be provided using the "wms_extent" metadata because there is no GetExtent() call for raster layers in MapServer.

How hard would it be to implement GetExtent() for rasters? Is there anything that prevents us from doing it?

Change History (21)

comment:1 by fwarmerdam, 22 years ago

Note that we don't maintain an open connection to raster layers, so we would
have to re-open them to satisfy this request.  Given that, it shouldn't be too
hard, but would require code and testing for each supported format.  

If we are to do this, I think we should consider a more omnibus call to collect
an assortment of metadata from a raster file rather than just addressing the
extents.  

comment:2 by dmorissette, 21 years ago

Cc: assefa@… added
Severity: normalenhancement
Version: 3.54.1
No time for this in 4.0, maybe in 4.1?

comment:3 by hobu, 20 years ago

dependson: 786

comment:4 by fwarmerdam, 20 years ago

Daniel,

For WCS we implemented the msWCSGetCoverageMetadata() function which provides
extents (and other?) information that might be useful for WMS as well.  
Unfortunately the information is currently returned in a coverageMetadataObj

We could conceivably move some of the logic out. 

comment:5 by dmorissette, 20 years ago

I started looking at the new msWCSGetCoverageMetadata() and then found out that
it calls msLayerGetExtent() which has been upgraded to support raster layers.
This is already what the WMS code calls.

Is there really anything to extract from the WCS code? It seems to me that this
bug would have been fixed by your changes, but I didn't do any testing to verify
that.

comment:6 by dmorissette, 20 years ago

Um... the msOWSGetLayerExtent() systematically returns MS_FAILURE for raster
layers. I'll need to look into that.

comment:7 by dmorissette, 20 years ago

Milestone: 4.4 release

comment:8 by mapserver@…, 20 years ago

Cc: mapserver@… added

comment:9 by fwarmerdam, 20 years ago

Note, bug 862 is also related to this bug.  It requests that non-square support
mode be enabled by default for WMS mode. 

comment:10 by fwarmerdam, 20 years ago

msOWSGetLayerExtent() just checks the metadata for rasters, and if that isn't
set fails out with MS_FAILURE.  

PS. Please ignore the previous comment I made about bug 862 ... it went into the
wrong bug report.  

This bug is currently assigned to Daniel.  If you wish, you can assign it to me
and I will implement an appropriate low level function that can be called
from msWCSGetCoverageMetadata() and msOWSGetLayerExtent() to get the extent. 


comment:11 by dmorissette, 20 years ago

Owner: changed from dmorissette@… to fwarmerdam
Since you asked. The bug is yours Frank.  ;)

comment:12 by tomkralidis, 19 years ago

This would be a great feature to put in.  What would happen when this is
implemented AND users have "wms_extent" in their mapfile?

comment:13 by fwarmerdam, 19 years ago

Status: newassigned
Tom,

Currently layer metadata is consulted first and takes precidence.  This
allows people to "fixup" bad metadata and it can also be a performance bonus
for formats that are expensive to open to query such information. 

I had quite forgotten I promised to do this!

comment:14 by sdlime, 19 years ago

Should default to the dataset extent and then fall back to metadata if not
present. I believe the WCS code has a metadata "mining" piece that could be
generalize or somehow leveraged...

Steve

comment:15 by dmorissette, 19 years ago

Actually, I am thinking that wms_extent should take precedence if it is set, so
that you can override the default extent. I would think that this is already the
case for vectors so we should be consistent between vectors and rasters, I can
see a few reasons why you may want to override default extents:
1- If the driver's GetExtent() is an expensive call (that's the case of some
vector formats)
2- If the driver's GetExtents() returns invalid information for some reason,
e.g. some misconfigured db with -180,-90,180,90 extents
3- If you simply want to override the default extents and publish you own
smaller or larger extents

comment:16 by sdlime, 19 years ago

Sorry, I hadn't seen Frank's reply, didn't mean to confuse the issue. Dan and
Frank's plans are just fine.

comment:17 by tomkralidis, 19 years ago

This is fine with me.  Shall this be targetted for 4.8?

comment:18 by warmerdam, 17 years ago

Description: modified (diff)
Keywords: raster extent added
Milestone: 5.0 release5.2 release
Priority: highnormal

Pushing to 5.2

comment:19 by dmorissette, 15 years ago

Description: modified (diff)
Milestone: 5.2.1 release6.0 release

comment:20 by warmerdam, 15 years ago

Resolution: fixed
Status: assignedclosed

I have committed an implementation of msRASTERLayerGetExtent() that will open the file and fetch the extent for simple raster files - that is, when tile indexes are not used.

Applied in trunk (r8677). I also added a modest test that demonstrates this works for simple file raster layers and does not work for tileindex layers in msautotest (r8676).

This change could be migrated to the 5.4 branch fairly safely I think if someone wants it and is willing to do some validation.

Presumably this will help for WMS and WCS serving.

comment:21 by jmckenna, 15 years ago

Cc: jmckenna added
Note: See TracTickets for help on using tickets.