Skip to content
Permalink
Browse files

fix protocol depending on service type in ISO metadata (#5669)

  • Loading branch information...
tomkralidis committed Oct 24, 2018
1 parent 5cd3b90 commit 3c44e49059e113ae6584fa4dba067618b765fb2e
@@ -89,6 +89,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
char *url = NULL;
char buffer[32];
char *epsg_str;
char *link_protocol;

xmlNodePtr psNode = NULL;
xmlNodePtr psORNode = NULL;
@@ -108,6 +109,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
url = msStringConcatenate(url, msEncodeHTMLEntities("&crs="));
msOWSGetEPSGProj(&(layer->projection), &(layer->metadata), "MFCSGO", MS_TRUE, &epsg_str);
url = msStringConcatenate(url, msEncodeHTMLEntities(epsg_str));
link_protocol = "WWW:DOWNLOAD-1.0-http-get-map";

status = msLayerGetExtent(layer, &rect);

@@ -127,12 +129,14 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
}
}
else if (strcasecmp(service, "F") == 0) {
link_protocol = "WWW:DOWNLOAD-1.0-http--download";
url = msStringConcatenate(url, msEncodeHTMLEntities("service=WFS&version=1.1.0&request=GetFeature&typename="));
url = msStringConcatenate(url, msEncodeHTMLEntities(layer->name));
url = msStringConcatenate(url, msEncodeHTMLEntities("&outputformat="));
url = msStringConcatenate(url, msEncodeHTMLEntities(format));
}
else if (strcasecmp(service, "C") == 0) {
link_protocol = "WWW:DOWNLOAD-1.0-http--download";
url = msStringConcatenate(url, msEncodeHTMLEntities("service=WCS&version=2.0.1&request=GetCoverage&coverageid="));
url = msStringConcatenate(url, msEncodeHTMLEntities(layer->name));
url = msStringConcatenate(url, msEncodeHTMLEntities("&format="));
@@ -141,7 +145,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi

xmlAddChild(psORNode, _msMetadataGetURL(namespace, "linkage", url));

xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "protocol", "WWW:DOWNLOAD-1.0-http--download"));
xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "protocol", link_protocol));
xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "name", layer->name));

xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "description", desc));
@@ -227,7 +227,7 @@ Content-type: text/xml
<gmd:URL>http://localhost/ows?service=WMS&amp;version=1.3.0&amp;request=GetMap&amp;width=500&amp;height=300&amp;styles=&amp;layers=toronto&amp;format=image/png&amp;crs=EPSG:32611&amp;bbox=4945950.00000,456800.00000,4957150.00000,469300.00000</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http--download</gco:CharacterString>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http-get-map</gco:CharacterString>
</gmd:protocol>
<gmd:name>
<gco:CharacterString>toronto</gco:CharacterString>
@@ -243,7 +243,7 @@ Content-type: text/xml
<gmd:URL>http://localhost/ows?service=WMS&amp;version=1.3.0&amp;request=GetMap&amp;width=500&amp;height=300&amp;styles=&amp;layers=toronto&amp;format=image/jpeg&amp;crs=EPSG:32611&amp;bbox=4945950.00000,456800.00000,4957150.00000,469300.00000</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http--download</gco:CharacterString>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http-get-map</gco:CharacterString>
</gmd:protocol>
<gmd:name>
<gco:CharacterString>toronto</gco:CharacterString>
@@ -229,7 +229,7 @@ Content-type: text/xml
<gmd:URL>http://localhost/ows?service=WMS&amp;version=1.3.0&amp;request=GetMap&amp;width=500&amp;height=300&amp;styles=&amp;layers=province&amp;format=image/png&amp;crs=&amp;bbox=-76361.77343,2253355.75000,515489.03125,2747648.50000</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http--download</gco:CharacterString>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http-get-map</gco:CharacterString>
</gmd:protocol>
<gmd:name>
<gco:CharacterString>province</gco:CharacterString>
@@ -245,7 +245,7 @@ Content-type: text/xml
<gmd:URL>http://localhost/ows?service=WMS&amp;version=1.3.0&amp;request=GetMap&amp;width=500&amp;height=300&amp;styles=&amp;layers=province&amp;format=image/jpeg&amp;crs=&amp;bbox=-76361.77343,2253355.75000,515489.03125,2747648.50000</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http--download</gco:CharacterString>
<gco:CharacterString>WWW:DOWNLOAD-1.0-http-get-map</gco:CharacterString>
</gmd:protocol>
<gmd:name>
<gco:CharacterString>province</gco:CharacterString>

0 comments on commit 3c44e49

Please sign in to comment.
You can’t perform that action at this time.