MCPcopy Index your code
hub / github.com/MapServer/MapServer / msWCSValidateAndFindAxes20

Function msWCSValidateAndFindAxes20

mapwcs20.c:1366–1442  ·  view source on GitHub ↗

/ msWCSValidateAndFindSubsets20() */ / Iterates over every axis in the parameters and checks if the */ axis name is in any string list. If found, but there already is */ a sample found for this axis, an Error is returned. Also if no */ axis is found for a given axis, an error is returned. */ /

Source from the content-addressed store, hash-verified

1364/* axis is found for a given axis, an error is returned. */
1365/************************************************************************/
1366static int msWCSValidateAndFindAxes20(
1367 wcs20ParamsObjPtr params,
1368 char*** validAxisNames,
1369 int numAxis,
1370 wcs20AxisObjPtr outAxes[])
1371{
1372 int iParamAxis, iAcceptedAxis, iName, i;
1373
1374 for(i = 0; i < numAxis; ++i)
1375 {
1376 outAxes[i] = NULL;
1377 }
1378
1379 /* iterate over all subsets */
1380 for(iParamAxis = 0; iParamAxis < params->numaxes; ++iParamAxis)
1381 {
1382 int found = 0;
1383
1384 /* check if subset is valid */
1385 if(params->axes[iParamAxis]->subset != NULL)
1386 {
1387 if(params->axes[iParamAxis]->subset->timeOrScalar == MS_WCS20_TIME_VALUE)
1388 {
1389 msSetError(MS_WCSERR, "Time values for subsets are not supported. ",
1390 "msWCSCreateBoundingBox20()");
1391 return MS_FAILURE;
1392 }
1393 if(params->axes[iParamAxis]->subset->operation == MS_WCS20_SLICE)
1394 {
1395 msSetError(MS_WCSERR, "Subset operation 'slice' is not supported.",
1396 "msWCSCreateBoundingBox20()");
1397 return MS_FAILURE;
1398 }
1399 }
1400
1401 /* iterate over all given axes */
1402 for(iAcceptedAxis = 0; iAcceptedAxis < numAxis; ++iAcceptedAxis )
1403 {
1404 /* iterate over all possible names for the current axis */
1405 for(iName = 0; validAxisNames[iAcceptedAxis][iName] != NULL ; ++iName)
1406 {
1407 /* compare axis name with current possible name */
1408 if(EQUAL(params->axes[iParamAxis]->name, validAxisNames[iAcceptedAxis][iName]))
1409 {
1410 /* if there is already a sample for the axis, throw error */
1411 if(outAxes[iAcceptedAxis] != NULL)
1412 {
1413 msSetError(MS_WCSERR, "The axis with the name '%s' corresponds "
1414 "to the same axis as the subset with the name '%s'.",
1415 "msWCSValidateAndFindSubsets20()",
1416 outAxes[iAcceptedAxis]->name, params->axes[iParamAxis]->name);
1417 return MS_FAILURE;
1418 }
1419
1420 /* if match is found, save it */
1421 outAxes[iAcceptedAxis] = params->axes[iParamAxis];
1422 found = 1;
1423 break;

Callers 1

Calls 1

msSetErrorFunction · 0.85

Tested by

no test coverage detected