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

Function msWCSGetCapabilities11_CoverageSummary

mapwcs11.c:235–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233/************************************************************************/
234
235static int msWCSGetCapabilities11_CoverageSummary(
236 mapObj *map, wcsParamsObj *params, cgiRequestObj *req,
237 xmlDocPtr doc, xmlNodePtr psContents, layerObj *layer )
238
239{
240 coverageMetadataObj cm;
241 int status;
242 const char *value;
243 char *owned_value;
244 char *format_list;
245 xmlNodePtr psCSummary;
246 xmlNsPtr psOwsNs = xmlSearchNs( doc, psContents, BAD_CAST "ows" );
247 char **tokens = NULL;
248 int i = 0;
249 int n = 0;
250
251 status = msWCSGetCoverageMetadata(layer, &cm);
252 if(status != MS_SUCCESS) return MS_FAILURE;
253
254 psCSummary = xmlNewChild( psContents, NULL, BAD_CAST "CoverageSummary", NULL );
255
256/* -------------------------------------------------------------------- */
257/* Title (from description) */
258/* -------------------------------------------------------------------- */
259 value = msOWSLookupMetadata( &(layer->metadata), "CO", "description");
260 if( value == NULL )
261 value = msOWSLookupMetadata( &(layer->metadata), "CO", "title");
262 if( value == NULL )
263 value = layer->name;
264 xmlNewChild( psCSummary, psOwsNs, BAD_CAST "Title", BAD_CAST value );
265
266/* -------------------------------------------------------------------- */
267/* Abstract */
268/* -------------------------------------------------------------------- */
269 value = msOWSLookupMetadata( &(layer->metadata), "CO", "abstract");
270 xmlNewChild( psCSummary, psOwsNs, BAD_CAST "Abstract", BAD_CAST value );
271
272/* -------------------------------------------------------------------- */
273/* Keywords */
274/* -------------------------------------------------------------------- */
275 value = msOWSLookupMetadata(&(layer->metadata), "CO", "keywordlist");
276
277 if (value) {
278 xmlNodePtr psNode;
279
280 psNode = xmlNewChild(psCSummary, psOwsNs, BAD_CAST "Keywords", NULL);
281
282 tokens = msStringSplit(value, ',', &n);
283 if (tokens && n > 0) {
284 for (i=0; i<n; i++) {
285 xmlNewChild(psNode, NULL, BAD_CAST "Keyword", BAD_CAST tokens[i] );
286 }
287 msFreeCharArray(tokens, n);
288 }
289 }
290
291/* -------------------------------------------------------------------- */
292/* Metadata Link */

Callers 1

msWCSGetCapabilities11Function · 0.85

Calls 10

msWCSGetCoverageMetadataFunction · 0.85
msOWSLookupMetadataFunction · 0.85
msStringSplitFunction · 0.85
msFreeCharArrayFunction · 0.85
msOWSGetProjURNFunction · 0.85
msDebugFunction · 0.85
msLibXml2GenerateListFunction · 0.85
msFreeFunction · 0.85
msWCSGetFormatsList11Function · 0.85

Tested by

no test coverage detected