Commit 9299bc6a authored by Kim Mortimer's avatar Kim Mortimer
Browse files

Switching name of element, trying some polygon stuff

parent 2555a218
......@@ -668,40 +668,39 @@
<geojson>
<xsl:text>{"type": "Polygon",</xsl:text>
<xsl:text>"coordinates": [
[</xsl:text><!--
[</xsl:text>
<xsl:choose>
determine what type of coordinates are being used
<!--determine what type of coordinates are being used-->
<xsl:when test="./gml:exterior/gml:LinearRing/gml:pos">
read each position in the list
<!--read each position in the list
TODO: Figure out how to compute handedness of the polygon
also N.B. that a WGS 84 object is going to be in latitude, longitude but GeoJSON expects longitude, latitude
- if it complains about separator we need to try an XSLT-1.0 implementation, I'm hopeful it might be 2.0
- if it complains about separator we need to try an XSLT-1.0 implementation, I'm hopeful it might be 2.0 -->
<xsl:for-each select="gml:exterior/gml:LinearRing/gml:pos">
<xsl:value-of select="concat('[', substring-after(. ,'\s'), ', ', substring-before(., '\s'), ']')" separator=","/>
<xsl:value-of select="concat('[', substring-before(. ,'\s'), ', ', substring-after(., '\s'), ']')" separator=","/>
</xsl:for-each>
<xsl:text>,</xsl:text>
<xsl:value-of select="concat('[', substring-after(gml:exterior/gml:LinearRing/gml:pos[1], '\s'), ', ', substring-before(gml:exterior/gml:LinearRing/gml:pos[1], '\s'), ']')"/>
<xsl:value-of select="concat('[', substring-before(gml:exterior/gml:LinearRing/gml:pos[1], '\s'), ', ', substring-after(gml:exterior/gml:LinearRing/gml:pos[1], '\s'), ']')"/>
</xsl:when>
<xsl:when test="./gml:exterior/gml:LinearRing/gml:pointProperty">
pretty much the same as the above except deeper inside
TODO: Figure out how to compute handedness of the polygon
<!--pretty much the same as the above except deeper inside
TODO: Figure out how to compute handedness of the polygon -->
<xsl:for-each select="gml:exterior/gml:LinearRing/gml:pointProperty/gml:Point/gml:pos">
<xsl:value-of select="concat('[', substring-after(. ,'\s'), ', ', substring-before(., '\s'), ']')" separator=","/>
<xsl:value-of select="concat('[', substring-before(. ,'\s'), ', ', substring-after(., '\s'), ']')" separator=","/>
</xsl:for-each>
<xsl:text>,</xsl:text>
<xsl:value-of select="concat('[', substring-after(gml:exterior/gml:LinearRing/gml:pointProperty/gml:Point/gml:pos[1], '\s'), ', ', substring-before(gml:exterior/gml:LinearRing/gml:pointProperty/gml:Point/gml:pos[1], '\s'), ']')"/>
<xsl:value-of select="concat('[', substring-before(gml:exterior/gml:LinearRing/gml:pointProperty/gml:Point/gml:pos[1], '\s'), ', ', substring-after(gml:exterior/gml:LinearRing/gml:pointProperty/gml:Point/gml:pos[1], '\s'), ']')"/>
</xsl:when>
<xsl:when test="./gml:exterior/gml:LinearRing/gml:posList">
This is an unbroken list of coordinates so there is only one value to get
<!--This is an unbroken list of coordinates so there is only one value to get -->
<xsl:variable name="temp" as="xs:string*" select="tokenize(gml:exterior/gml:LinearRing/gml:posList, '\s')"/>
</xsl:when>
<xsl:otherwise>
deprecated coordinates, pointRep - do nothing
<!-- insert new function here to handle coordinates, but posRep shouldn't work -->
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<!--<xsl:choose>
<xsl:when test="./gml:interior">
<xsl:for-each select="gml:interior">
<xsl:choose>
......@@ -971,7 +970,7 @@
as="xs:string?"/>
<xsl:variable name="date"
select="string(gmd:date[1]/gco:Date|gmd:date[1]/gco:DateTime)"/>
<operationType><xsl:value-of select="$dateType"/></operationType>
<operationDteType><xsl:value-of select="$dateType"/></operationDteType>
<operationDate><xsl:value-of select="$date"/></operationDate>
</xsl:for-each>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment