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: geonetwork-devel@…
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&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;SERVICE=WMS&amp;SRS=EPSG:4326&amp;WIDTH=512&amp;HEIGHT=512&amp;LAYERS=&amp;TRANSPARENT=TRUE&amp;STYLES=&amp;FORMAT=image/png&amp;</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&#0038;REQUEST=GetMap&#0038;SERVICE=WMS&#0038;SRS=EPSG:4326&#0038;WIDTH=512&#0038;HEIGHT=512&#0038;LAYERS=<xsl:value-of select="@name"/>&#0038;TRANSPARENT=TRUE&#0038;STYLES=&#0038;FORMAT=image/png&#0038;</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&#0038;REQUEST=GetMap&#0038;SERVICE=WMS&#0038;SRS=EPSG:4326&#0038;WIDTH=512&#0038;HEIGHT=512&#0038;LAYERS=<xsl:value-of select="@name"/>&#0038;TRANSPARENT=TRUE&#0038;STYLES=&#0038;FORMAT=image/png&#0038;</href>

...by...

<Icon>
<href><xsl:value-of select="@href"/><xsl:value-of select="$qm"/>VERSION=1.1.1&#0038;REQUEST=GetMap&#0038;SERVICE=WMS&#0038;SRS=EPSG:4326&#0038;WIDTH=512&#0038;HEIGHT=512&#0038;LAYERS=<xsl:value-of select="$layer"/>&#0038;TRANSPARENT=TRUE&#0038;STYLES=&#0038;FORMAT=image/png&#0038;</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 FranckTheeten, 13 years ago

Milestone: v2.6.5

comment:2 by FranckTheeten, 13 years ago

Milestone: Future release
Note: See TracTickets for help on using tickets.