Skip to content

Commit

Permalink
Adjust exceptionCode in WCS 2.0 (MapServer#4735).
Browse files Browse the repository at this point in the history
  • Loading branch information
Schpidi committed Aug 18, 2013
1 parent d3ec344 commit 36e2f74
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions mapwcs20.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 36e2f74

Please sign in to comment.