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

Function msWCSGetCapabilities11

mapwcs11.c:367–621  ·  view source on GitHub ↗

/ msWCSGetCapabilities11() */ /

Source from the content-addressed store, hash-verified

365/* msWCSGetCapabilities11() */
366/************************************************************************/
367int msWCSGetCapabilities11(mapObj *map, wcsParamsObj *params,
368 cgiRequestObj *req, owsRequestObj *ows_request)
369{
370 xmlDocPtr psDoc = NULL; /* document pointer */
371 xmlNodePtr psRootNode, psMainNode, psNode;
372 xmlNodePtr psTmpNode;
373 char *identifier_list = NULL, *format_list = NULL;
374 const char *updatesequence=NULL;
375 const char *encoding;
376 xmlNsPtr psOwsNs, psXLinkNs;
377 char *schemaLocation = NULL;
378 char *xsi_schemaLocation = NULL;
379 char *script_url=NULL, *script_url_encoded=NULL;
380
381 xmlChar *buffer = NULL;
382 int size = 0, i;
383 msIOContext *context = NULL;
384
385 int ows_version = OWS_1_1_0;
386
387/* -------------------------------------------------------------------- */
388/* Handle updatesequence */
389/* -------------------------------------------------------------------- */
390
391 updatesequence = msOWSLookupMetadata(&(map->web.metadata), "CO", "updatesequence");
392 encoding = msOWSLookupMetadata(&(map->web.metadata), "CO", "encoding");
393
394 if (params->updatesequence != NULL) {
395 i = msOWSNegotiateUpdateSequence(params->updatesequence, updatesequence);
396 if (i == 0) { /* current */
397 msSetError(MS_WCSERR, "UPDATESEQUENCE parameter (%s) is equal to server (%s)", "msWCSGetCapabilities11()", params->updatesequence, updatesequence);
398 return msWCSException11(map, "updatesequence", "CurrentUpdateSequence", params->version);
399 }
400 if (i > 0) { /* invalid */
401 msSetError(MS_WCSERR, "UPDATESEQUENCE parameter (%s) is higher than server (%s)", "msWCSGetCapabilities11()", params->updatesequence, updatesequence);
402 return msWCSException11(map, "updatesequence", "InvalidUpdateSequence", params->version);
403 }
404 }
405
406/* -------------------------------------------------------------------- */
407/* Build list of layer identifiers available. */
408/* -------------------------------------------------------------------- */
409 identifier_list = msStrdup("");
410 for(i=0; i<map->numlayers; i++)
411 {
412 layerObj *layer = map->layers[i];
413 int new_length;
414
415 if(!msWCSIsLayerSupported(layer))
416 continue;
417
418 new_length = strlen(identifier_list) + strlen(layer->name) + 2;
419 identifier_list = (char *) realloc(identifier_list,new_length);
420
421 if( strlen(identifier_list) > 0 )
422 strcat( identifier_list, "," );
423 strcat( identifier_list, layer->name );
424 }

Callers 1

msWCSGetCapabilitiesFunction · 0.85

Calls 15

msOWSLookupMetadataFunction · 0.85
msSetErrorFunction · 0.85
msWCSException11Function · 0.85
msStrdupFunction · 0.85
msWCSIsLayerSupportedFunction · 0.85
msEncodeHTMLEntitiesFunction · 0.85
msOWSGetSchemasLocationFunction · 0.85
msStringConcatenateFunction · 0.85
msOWSGetOnlineResourceFunction · 0.85

Tested by

no test coverage detected