Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Infrastructure
iso19139.MERIDIAN
Commits
2456ab69
Commit
2456ab69
authored
Apr 15, 2019
by
Kim Mortimer
Browse files
Add closing point to polygons
parent
45beb3c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/plugin/iso19139.MERIDIAN/index-fields/index.xsl
View file @
2456ab69
...
...
@@ -657,15 +657,19 @@
<!-- 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 -->
<xsl:for-each
select=
"gml:exterior/gml:LinearRing/gml:pos"
>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
'), ', ', substring-before(., '
'), ']')"
separator=
","
/>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
\s
'), ', ', substring-before(., '
\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: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 -->
<xsl:for-each
select=
"gml:exterior/gml:LinearRing/gml:pointProperty/gml:Point/gml:pos"
>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
'), ', ', substring-before(., '
'), ']')"
separator=
","
/>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
\s
'), ', ', substring-before(., '
\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: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 -->
...
...
@@ -685,8 +689,10 @@
[
</xsl:text>
<!-- TODO: Figure out how to compute handedness of the polygon -->
<xsl:for-each
select=
"gml:LinearRing/gml:pos"
>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
'), ', ', substring-before(., '
'), ']')"
separator=
","
/>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
\s
'), ', ', substring-before(., '
\s
'), ']')"
separator=
","
/>
</xsl:for-each>
<xsl:text>
,
</xsl:text>
<xsl:value-of
select=
"concat('[', substring-after(gml:LinearRing/gml:pos[1], '\s'), ', ', substring-before(gml:LinearRing/gml:pos[1], '\s'), ']')"
/>
<xsl:text>
]
</xsl:text>
</xsl:when>
<xsl:when
test=
"./gml:LinearRing/gml:pointProperty"
>
...
...
@@ -694,8 +700,10 @@
[
</xsl:text>
<!-- TODO: Figure out how to compute handedness of the polygon -->
<xsl:for-each
select=
"gml:LinearRing/gml:pointProperty/gml:Point/gml:pos"
>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
'), ', ', substring-before(., '
'), ']')"
separator=
","
/>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
\s
'), ', ', substring-before(., '
\s
'), ']')"
separator=
","
/>
</xsl:for-each>
<xsl:text>
,
</xsl:text>
<xsl:value-of
select=
"concat('[', substring-after(gml:LinearRing/gml:pointProperty/gml:Point/gml:pos[1], '\s'), ', ', substring-before(gml:LinearRing/gml:pointProperty/gml:Point/gml:pos[1], '\s'), ']')"
/>
<xsl:text>
]
</xsl:text>
</xsl:when>
<xsl:when
test=
"./gml:LinearRing/gml:posList"
>
...
...
@@ -723,7 +731,7 @@
<geom>
<xsl:text>
{"type": "Point",
</xsl:text>
<xsl:text>
"coordinates":
</xsl:text>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
'), ', ', substring-before(., '
'), ']')"
/>
<xsl:value-of
select=
"concat('[', substring-after(. ,'
\s
'), ', ', substring-before(., '
\s
'), ']')"
/>
<xsl:text>
}
</xsl:text>
</geom>
</xsl:for-each>
...
...
@@ -841,7 +849,7 @@
<xsl:variable
name=
"measureName"
select=
"replace(
normalize-space(
gmd:nameOfMeasure[0]/gco:CharacterString), '
', '-')"
/>
gmd:nameOfMeasure[0]/gco:CharacterString), '
\s
', '-')"
/>
<xsl:for-each
select=
"gmd:result/gmd:DQ_QuantitativeResult/gmd:value"
>
<xsl:if
test=
". != ''"
>
<xsl:element
name=
"measure_{replace($measureName, '[^a-zA-Z0-9]', '')}"
>
...
...
@@ -957,7 +965,7 @@
as=
"xs:string*"
/>
<xsl:variable
name=
"role"
select=
"replace(*[1]/gmd:role/*/@codeListValue, '
', '')"
select=
"replace(*[1]/gmd:role/*/@codeListValue, '
\s
', '')"
as=
"xs:string?"
/>
<xsl:if
test=
"normalize-space($organisationName) != ''"
>
<xsl:element
name=
"Org{$fieldSuffix}"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment