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

Function msWCSGetCoverageBands11

mapwcs11.c:1034–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1032
1033#if defined(USE_WCS_SVR)
1034int msWCSGetCoverageBands11( mapObj *map, cgiRequestObj *request,
1035 wcsParamsObj *params, layerObj *lp,
1036 char **p_bandlist )
1037
1038{
1039 char *rangesubset, *field_id;
1040 const char *axis_id, *value;
1041 int i;
1042
1043/* -------------------------------------------------------------------- */
1044/* Fetch the RangeSubset from the parameters, skip building a */
1045/* bands list if not found. */
1046/* -------------------------------------------------------------------- */
1047 value = msWCSGetRequestParameter(request, "RangeSubset");
1048 if( value == NULL )
1049 return MS_SUCCESS;
1050
1051 rangesubset = msStrdup(value);
1052
1053/* -------------------------------------------------------------------- */
1054/* What is the <Field identifier=...> (rangeset_name)? */
1055/* -------------------------------------------------------------------- */
1056 value = msOWSLookupMetadata( &(lp->metadata), "CO", "rangeset_name" );
1057 if( value == NULL )
1058 value = "raster";
1059 field_id = msStrdup(value);
1060
1061/* -------------------------------------------------------------------- */
1062/* What is the <Axis identifier=...> (bands_name)? */
1063/* -------------------------------------------------------------------- */
1064 axis_id = msOWSLookupMetadata( &(lp->metadata), "CO", "bands_name" );
1065 if( axis_id == NULL )
1066 axis_id = "bands";
1067
1068/* -------------------------------------------------------------------- */
1069/* Parse out the field identifier from the request and verify. */
1070/* -------------------------------------------------------------------- */
1071 value = rangesubset + strlen(field_id);
1072
1073 if( strcasecmp(rangesubset,field_id) == 0 )
1074 return MS_SUCCESS; /* we only got field ... default options */
1075
1076 if( strlen(rangesubset) <= strlen(field_id)+1
1077 || strncasecmp(rangesubset,field_id,strlen(field_id)) != 0
1078 || (*value != '[' && *value != ':') )
1079 {
1080 msSetError( MS_WCSERR,
1081 "RangeSubset field name malformed, expected '%s', got RangeSubset=%s",
1082 "msWCSGetCoverageBands11()",
1083 field_id, rangesubset );
1084 return msWCSException11(map, "mapserv", "NoApplicableCode", params->version);
1085 }
1086
1087 free( field_id );
1088 field_id = NULL;
1089
1090/* -------------------------------------------------------------------- */
1091/* Parse out the interpolation, if found. */

Callers 1

msWCSGetCoverageFunction · 0.85

Calls 7

msWCSGetRequestParameterFunction · 0.85
msStrdupFunction · 0.85
msOWSLookupMetadataFunction · 0.85
strcasecmpFunction · 0.85
strncasecmpFunction · 0.85
msSetErrorFunction · 0.85
msWCSException11Function · 0.85

Tested by

no test coverage detected