[mapserver-commits] r9401 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed Oct 7 19:23:03 EDT 2009
Author: warmerdam
Date: 2009-10-07 19:23:02 -0400 (Wed, 07 Oct 2009)
New Revision: 9401
Modified:
trunk/mapserver/mapwcs.c
Log:
if we are missing size and resolution fallback to asking GDAL for file details in GetCoverageMetadata (#2683)
Modified: trunk/mapserver/mapwcs.c
===================================================================
--- trunk/mapserver/mapwcs.c 2009-10-07 22:48:08 UTC (rev 9400)
+++ trunk/mapserver/mapwcs.c 2009-10-07 23:23:02 UTC (rev 9401)
@@ -737,7 +737,10 @@
" xsi:schemaLocation=\"http://www.opengis.net/wcs %s/wcs/%s/wcsCapabilities.xsd\">\n", params->version, params->updatesequence, msOWSGetSchemasLocation(map), params->version);
for(i=0; i<map->numlayers; i++)
- msWCSGetCapabilities_CoverageOfferingBrief((GET_LAYER(map, i)), params);
+ {
+ if( msWCSGetCapabilities_CoverageOfferingBrief((GET_LAYER(map, i)), params) != MS_SUCCESS )
+ return MS_FAILURE;
+ }
/* done */
msIO_printf("</ContentMetadata>\n");
@@ -1914,8 +1917,11 @@
/* -------------------------------------------------------------------- */
/* If we have "virtual dataset" metadata on the layer, then use */
/* that in preference to inspecting the file(s). */
+ /* We require extent and either size or resolution. */
/* -------------------------------------------------------------------- */
- if( msOWSLookupMetadata(&(layer->metadata), "COM", "extent") != NULL ) {
+ if( msOWSLookupMetadata(&(layer->metadata), "COM", "extent") != NULL
+ && (msOWSLookupMetadata(&(layer->metadata), "COM", "resolution") != NULL
+ || msOWSLookupMetadata(&(layer->metadata), "COM", "size") != NULL) ){
const char *value;
/* get extent */
@@ -1976,7 +1982,7 @@
/* do we have information to do anything */
if( cm->xresolution == 0.0 || cm->yresolution == 0.0 || cm->xsize == 0 || cm->ysize == 0 ) {
- msSetError( MS_WCSERR, "Failed to collect extent and resolution for WCS coverage from metadata. Need value wcs|ows_resolution or wcs|ows_size values.", "msWCSGetCoverageMetadata()");
+ msSetError( MS_WCSERR, "Failed to collect extent and resolution for WCS coverage from metadata for layer '%s'. Need value wcs|ows_resolution or wcs|ows_size values.", "msWCSGetCoverageMetadata()", layer->name );
return MS_FAILURE;
}
More information about the mapserver-commits
mailing list