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

Function msWCSDescribeCoverage11

mapwcs11.c:888–1014  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886/************************************************************************/
887
888int msWCSDescribeCoverage11(mapObj *map, wcsParamsObj *params, owsRequestObj *ows_request)
889{
890 xmlDocPtr psDoc = NULL; /* document pointer */
891 xmlNodePtr psRootNode;
892 xmlNsPtr psOwsNs, psXLinkNs;
893 char *schemaLocation = NULL;
894 char *xsi_schemaLocation = NULL;
895 const char *encoding;
896
897 int i,j;
898
899 encoding = msOWSLookupMetadata(&(map->web.metadata), "CO", "encoding");
900
901/* -------------------------------------------------------------------- */
902/* We will actually get the coverages list as a single item in */
903/* a string list with that item having the comma delimited */
904/* coverage names. Split it up now, and assign back in place */
905/* of the old coverages list. */
906/* -------------------------------------------------------------------- */
907 if( CSLCount(params->coverages) == 1 )
908 {
909 char **old_coverages = params->coverages;
910 params->coverages = CSLTokenizeStringComplex( old_coverages[0], ",",
911 FALSE, FALSE );
912 CSLDestroy( old_coverages );
913 }
914
915/* -------------------------------------------------------------------- */
916/* Validate that the requested coverages exist as named layers. */
917/* -------------------------------------------------------------------- */
918 if(params->coverages) { /* use the list */
919 for( j = 0; params->coverages[j]; j++ ) {
920 i = msGetLayerIndex(map, params->coverages[j]);
921 if ( (i == -1) ||
922 (!msIntegerInArray(GET_LAYER(map, i)->index, ows_request->enabled_layers, ows_request->numlayers)) )
923 {
924 msSetError( MS_WCSERR,
925 "COVERAGE %s cannot be opened / does not exist",
926 "msWCSDescribeCoverage()", params->coverages[j]);
927 return msWCSException11(map, "coverage", "CoverageNotDefined", params->version);
928 }
929 }
930 }
931
932/* -------------------------------------------------------------------- */
933/* Create document. */
934/* -------------------------------------------------------------------- */
935 psDoc = xmlNewDoc(BAD_CAST "1.0");
936
937 psRootNode = xmlNewNode(NULL, BAD_CAST "CoverageDescriptions");
938
939 xmlDocSetRootElement(psDoc, psRootNode);
940
941/* -------------------------------------------------------------------- */
942/* Name spaces */
943/* -------------------------------------------------------------------- */
944 xmlSetNs(psRootNode, xmlNewNs(psRootNode, BAD_CAST "http://www.opengis.net/wcs/1.1", NULL));
945 psOwsNs = xmlNewNs(psRootNode, BAD_CAST MS_OWSCOMMON_OWS_110_NAMESPACE_URI, BAD_CAST MS_OWSCOMMON_OWS_NAMESPACE_PREFIX);

Callers 1

msWCSDescribeCoverageFunction · 0.85

Calls 14

msOWSLookupMetadataFunction · 0.85
msGetLayerIndexFunction · 0.85
msIntegerInArrayFunction · 0.85
msSetErrorFunction · 0.85
msWCSException11Function · 0.85
msEncodeHTMLEntitiesFunction · 0.85
msOWSGetSchemasLocationFunction · 0.85
msStrdupFunction · 0.85
msStringConcatenateFunction · 0.85
msIO_needBinaryStdoutFunction · 0.85
msIO_printfFunction · 0.85

Tested by

no test coverage detected