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

Function msWCSConvertRangeSetToString

mapwcs.c:101–131  ·  view source on GitHub ↗

/ msWCSConvertRangeSetToString() */ /

Source from the content-addressed store, hash-verified

99/* msWCSConvertRangeSetToString() */
100/************************************************************************/
101static char *msWCSConvertRangeSetToString(const char *value) {
102 char **tokens;
103 int numtokens;
104 double min, max, res;
105 double val;
106 char buf1[128], *buf2=NULL;
107
108 if(strchr(value, '/')) { /* value is min/max/res */
109 tokens = msStringSplit(value, '/', &numtokens);
110 if(tokens==NULL || numtokens != 3) {
111 msFreeCharArray(tokens, numtokens);
112 return NULL; /* not a set of equally spaced intervals */
113 }
114
115 min = atof(tokens[0]);
116 max = atof(tokens[1]);
117 res = atof(tokens[2]);
118 msFreeCharArray(tokens, numtokens);
119
120 for(val=min; val<=max; val+=res) {
121 if(val == min)
122 snprintf(buf1, sizeof(buf1), "%g", val);
123 else
124 snprintf(buf1, sizeof(buf1), ",%g", val);
125 buf2 = msStringConcatenate(buf2, buf1);
126 }
127
128 return buf2;
129 } else
130 return msStrdup(value);
131}
132
133/************************************************************************/
134/* msWCSException() */

Callers 1

msWCSGetCoverageBands10Function · 0.85

Calls 4

msStringSplitFunction · 0.85
msFreeCharArrayFunction · 0.85
msStringConcatenateFunction · 0.85
msStrdupFunction · 0.85

Tested by

no test coverage detected