Skip to content

Commit

Permalink
Moved nativeFormat element of CoverageDescriptions to the correct pla…
Browse files Browse the repository at this point in the history
…ce. (#4003).

ServiceMetadata is now a section like the other sections of Capabilities. Not yet conformant with the WCS 2.0 specs but obviously a bug.
  • Loading branch information
constantinius committed May 25, 2012
1 parent 786caa1 commit fac5e35
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions mapwcs20.c
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,7 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
psXLinkNs = NULL,
psWcsNs = NULL,
psGmlNs = NULL;
char *script_url=NULL, *script_url_encoded=NULL;
char *script_url=NULL, *script_url_encoded=NULL, *format_list=NULL;
int i;

/* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -3108,8 +3108,16 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
/* -------------------------------------------------------------------- */
/* Service metadata. */
/* -------------------------------------------------------------------- */
/* it is mandatory, but unused for now */
xmlAddChild(psRootNode, xmlNewNode(psWcsNs, BAD_CAST "ServiceMetadata"));

if ( MS_WCS_20_CAPABILITIES_INCLUDE_SECTION(params, "ServiceMetadata") )
{
psNode = xmlNewChild(psRootNode, psWcsNs, BAD_CAST "ServiceMetadata", NULL);

/* Add formats list */
format_list = msWCSGetFormatsList20(map, NULL);
msLibXml2GenerateList(psNode, psWcsNs, "formatSupported", format_list, ',');
msFree(format_list);
}

/* -------------------------------------------------------------------- */
/* Contents section. */
Expand Down Expand Up @@ -3275,19 +3283,21 @@ static int msWCSDescribeCoverage20_CoverageDescription(mapObj *map,
"SupportedFormat", format_list, ',');
}

if(cm.native_format != NULL)
{
xmlNewChild(psSupportedFormats, psWcsNs,
BAD_CAST "NativeFormat", BAD_CAST cm.native_format);
}
else
{
msDebug("msWCSDescribeCoverage20_CoverageDescription(): "
"No native format specified.\n");
}

msFree(format_list);
}

/* -------------------------------------------------------------------- */
/* nativeFormat */
/* -------------------------------------------------------------------- */
xmlNewChild(psSP, psWcsNs,
BAD_CAST "nativeFormat", BAD_CAST (cm.native_format ?
cm.native_format : ""));

if (!cm.native_format)
{
msDebug("msWCSDescribeCoverage20_CoverageDescription(): "
"No native format specified.\n");
}
}

msWCSClearCoverageMetadata20(&cm);
Expand Down

0 comments on commit fac5e35

Please sign in to comment.