From 36e2f744cd4c0283c95d1382090ed1a30a6dae6e Mon Sep 17 00:00:00 2001 From: Stephan Meissl Date: Sun, 18 Aug 2013 12:19:57 +0200 Subject: [PATCH] Adjust exceptionCode in WCS 2.0 (#4735). --- mapwcs20.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/mapwcs20.c b/mapwcs20.c index ce97116bd1..f03681ba31 100644 --- a/mapwcs20.c +++ b/mapwcs20.c @@ -1120,20 +1120,6 @@ static int msWCSValidateAndFindAxes20( for(iParamAxis = 0; iParamAxis < params->numaxes; ++iParamAxis) { int found = 0; - /* check if subset is valid */ - if(params->axes[iParamAxis]->subset != NULL) { - if(params->axes[iParamAxis]->subset->timeOrScalar == MS_WCS20_TIME_VALUE) { - msSetError(MS_WCSERR, "Time values for subsets are not supported. ", - "msWCSValidateAndFindAxes20()"); - return MS_FAILURE; - } - if(params->axes[iParamAxis]->subset->operation == MS_WCS20_SLICE) { - msSetError(MS_WCSERR, "Subset operation 'slice' is not supported.", - "msWCSValidateAndFindAxes20()"); - return MS_FAILURE; - } - } - /* iterate over all given axes */ for(iAcceptedAxis = 0; iAcceptedAxis < numAxis; ++iAcceptedAxis ) { /* iterate over all possible names for the current axis */ @@ -3213,6 +3199,22 @@ this request. Check wcs/ows_enable_request settings.", "msWCSGetCoverage20()", p "projection", params->version); } + /* iterate over all subsets and check if they are valid*/ + for(i = 0; i < params->numaxes; ++i) { + if(params->axes[i]->subset != NULL) { + if(params->axes[i]->subset->timeOrScalar == MS_WCS20_TIME_VALUE) { + msSetError(MS_WCSERR, "Time values for subsets are not supported. ", + "msWCSGetCoverage20()"); + return msWCSException(map, "InvalidSubsetting", "subset", params->version); + } + if(params->axes[i]->subset->operation == MS_WCS20_SLICE) { + msSetError(MS_WCSERR, "Subset operation 'slice' is not supported.", + "msWCSGetCoverage20()"); + return msWCSException(map, "InvalidSubsetting", "subset", params->version); + } + } + } + { wcs20AxisObjPtr *axes; axes = msSmallMalloc(sizeof(wcs20AxisObjPtr) * 2);