Ticket #3966 (closed defect: fixed)
WCS 1.1: call to msOWSCommonBoundingBox sets an error
| Reported by: | fschindler | Owned by: | sdlime |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.2 release |
| Component: | WCS Server | Version: | unspecified |
| Severity: | normal | Keywords: | OWS WCS DescribeCoverage |
| Cc: | warmerdam, schpidi |
Description
In WCS 1.1 DescribeCoverage requests produce errors in (swig)mapscript applications (not in CGI applications). The following case reproduces the error (it should work with any input image):
MAP
CONFIG "MS_ERRORFILE" "stderr"
WEB
METADATA
"ows_onlineresource" "http://something?"
"ows_enable_request" "*"
END
END
LAYER
NAME "a"
DUMP TRUE
DATA "test.tif"
TYPE RASTER
METADATA
"ows_srs" "EPSG:4326"
END
END
END
And this is the application python code:
import mapscript ows_req = mapscript.OWSRequest() ows_req.setParameter('SERVICE','WCS') ows_req.setParameter('REQUEST','DescribeCoverage') ows_req.setParameter('VERSION','1.1.0') ows_req.setParameter('COVERAGE','a') map = mapscript.mapObj('test.map') mapscript.msIO_installStdoutToBuffer() dispatch_status = map.OWSDispatch(ows_req) print mapscript.msIO_getStdoutBufferBytes()
When run it results in the following error:
Traceback (most recent call last):
File "disp.py", line 13, in <module>
dispatch_status = map.OWSDispatch(ows_req)
_mapscript.MapServerError: msLoadProjectionString(): Projection library error. Unrecognised OGC CRS def 'urn:ogc:def:crs:OGC::imageCRS'.
This is due to an error that is set in msLoadProjection() which is never reset (like in the msWCSException function). Because the error list is not reset an exception is thrown after the OWSDispatch.
The error occurs in msWCSDescribeCoverage_CoverageDescription11 when calling msOWSCommonBoundingBox() with the parameter crs = "urn:ogc:def:crs:OGC::imageCRS".
The following patch should resolve the problem by adding a check if the given CRS containts "imageCRS":
Index: mapowscommon.c
===================================================================
--- mapowscommon.c (revision 11972)
+++ mapowscommon.c (working copy)
@@ -512,6 +512,7 @@
xmlNodePtr psRootNode = NULL;
/* Do we need to reorient tuple axes? */
+ if(crs && strstr(crs, "imageCRS") == NULL)
{
projectionObj proj;

