Opened 13 years ago
Last modified 13 years ago
#713 new defect
GeoNetwork 2.6.4: error in kml.xsl: wrong XSL variable for layer name (with proposition of solution)
Reported by: | FranckTheeten | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Future release |
Component: | General | Version: | v2.6.4 |
Keywords: | Cc: | patricia.mergen@…; max.fernandez@… |
Description
Hi all,
I'm a new GeoNetwork user so I'm not sure I post the issue at the right location, and that it has not been solved in the meantime.
The problem is the following: 1: I use GeNetwork 2.6.4 2: I've harvested a WMS via OAI-PMH to generate a metadata catalogue. 3: The WMS layers have been indexed with the appropriate keywords and can be displayed on the interactive map. 4: ...but the file automatically created to view the layer in Google Earth features an error preventing its display.
I've checked kml.xsl which converts the main xml generated by GeoNetwork into KML and maybe found a workaround:
b) a) The error comes from incomplete parameters in the WMS "GetMap" request defined in the "GroundOverlay/Icon/href" and "ScreenOverLay/Icon/href" elements thatare generated by the xslt: the value of the LAYERS parameter is missing.
e.g.
<Icon><href>http://edit.africamuseum.be/geoserver/RMCA_Bedrock_and_Structural_Geology/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=512&HEIGHT=512&LAYERS=&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png&</href></Icon>
.
c) kml.xsl contains the following line (once for ScreenOverlay and once for GroundOverlay):
<Icon> <href><xsl:value-of select="@href"/><xsl:value-of select="$qm"/>VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=512&HEIGHT=512&LAYERS=<xsl:value-of select="@name"/>&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png&</href>
(lines 118 and 142 of "kml.xsl")
...but actually the name of the layer is not captured by "@name" but by a variable called "$layer" :
<xsl:variable name="layer" select="/root/request/layers"/>
(line 48 in my GeoNetwork)
So replacing...
<Icon> <href><xsl:value-of select="@href"/><xsl:value-of select="$qm"/>VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=512&HEIGHT=512&LAYERS=<xsl:value-of select="@name"/>&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png&</href>
...by...
<Icon> <href><xsl:value-of select="@href"/><xsl:value-of select="$qm"/>VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=512&HEIGHT=512&LAYERS=<xsl:value-of select="$layer"/>&TRANSPARENT=TRUE&STYLES=&FORMAT=image/png&</href>
"
...in ./geonetwork/xsl/kml.xsl seems to solve the problem.
Maybe the change could be commited to the version stored in the repository?
Franck Theeten Web developer and database manager Royal Museum for Central Africa, Tervuren, Belgium
Change History (2)
comment:1 by , 13 years ago
Milestone: | v2.6.5 |
---|
comment:2 by , 13 years ago
Milestone: | → Future release |
---|