Skip to content

Commit

Permalink
WFS 2.0: generate correct MetadataURL element, and add optional wfs_m…
Browse files Browse the repository at this point in the history
…etadataurl_about layer metadata item (#4886)
  • Loading branch information
rouault committed Mar 20, 2014
1 parent 1938666 commit f4b969d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
30 changes: 21 additions & 9 deletions mapwfs11.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,21 +225,33 @@ xmlNodePtr msWFSDumpLayer11(mapObj *map, layerObj *lp, xmlNsPtr psNsOws,
value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_href");

if (value) {
psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "MetadataURL", BAD_CAST value);
if( nWFSVersion >= OWS_2_0_0 )
{
psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "MetadataURL", NULL);
xmlNewProp(psNode, BAD_CAST "xlink:href", BAD_CAST value);

value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_about");
if( value != NULL )
xmlNewProp(psNode, BAD_CAST "about", BAD_CAST value);
}
else
{
psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "MetadataURL", BAD_CAST value);

value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_format");
value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_format");

if (!value)
value = msStrdup("text/html"); /* default */
if (!value)
value = msStrdup("text/html"); /* default */

xmlNewProp(psNode, BAD_CAST "format", BAD_CAST value);
xmlNewProp(psNode, BAD_CAST "format", BAD_CAST value);

value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_type");
value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_type");

if (!value)
value = msStrdup("FGDC"); /* default */
if (!value)
value = msStrdup("FGDC"); /* default */

xmlNewProp(psNode, BAD_CAST "type", BAD_CAST value);
xmlNewProp(psNode, BAD_CAST "type", BAD_CAST value);
}
}

return psRootNode;
Expand Down
2 changes: 1 addition & 1 deletion msautotest
Submodule msautotest updated from df76b2 to a65ae1

0 comments on commit f4b969d

Please sign in to comment.