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
81f9aa07
Commit
81f9aa07
authored
Sep 26, 2019
by
Kim Mortimer
Browse files
Removes list of lists, adds instructions, testing of some polygon stuff
parent
a2b232b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/plugin/iso19139.MERIDIAN/index-fields/index.xsl
View file @
81f9aa07
...
...
@@ -136,7 +136,7 @@
I use a check for a controlled leading string that would be unlikely to be present in other records. -->
<document>
<xsl:if
test=
"./gmd:identificationInfo/MER:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:otherCitationDetails/gco:CharacterString[starts-with(text(),'MERIDIAN-CITE-AS: ')]"
>
<xsl:value-of
select=
"./gmd:identificationInfo/MER:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:otherCitationDetails/gco:CharacterString"
/>
<xsl:value-of
select=
"
substring-after(
./gmd:identificationInfo/MER:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:otherCitationDetails/gco:CharacterString
, ':')
"
/>
</xsl:if>
</document>
<uuid>
...
...
@@ -653,21 +653,18 @@
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
<!--<xsl:value-of select="($e + $w) div 2"/>,<xsl:value-of select="($n + $s) div 2"/></field>-->
</xsl:for-each>
<xsl:for-each
select=
".//gmd:EX_BoundingPolygon/gmd:polygon/gml:Polygon"
>
<xsl:if
test=
"ends-with(@srsName, '84') or ends-with(@srsName, '4326') or not(@srsName)"
>
<!-- if it's not in WGS 84 we can't convert to geoJson
<!--if it's not in WGS 84 we can't convert to geoJson
if it's a polygon it has an exterior
initialize geoJson
initialize geoJson
-->
<geojson>
<xsl:text>
{"type": "Polygon",
</xsl:text>
<xsl:text>
"coordinates": [
[</xsl:text>
[
</xsl:text>
<!--
<xsl:choose>
determine what type of coordinates are being used
<xsl:when test="./gml:exterior/gml:LinearRing/gml:pos">
...
...
@@ -739,12 +736,15 @@
</xsl:choose>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:otherwise>
-->
<xsl:text>
]
</xsl:text>
</xsl:otherwise>
</xsl:choose>
<!--
</xsl:otherwise>
</xsl:choose>
-->
<xsl:text>
] }
</xsl:text>
</geojson>-->
</geojson>
<!-- how to determine the average location of a poylgon? -->
<location>
</location>
</xsl:if>
</xsl:for-each>
<xsl:for-each
select=
".//gmd:EX_BoundingPolygon/gmd:polygon/gml:Point"
>
...
...
@@ -757,19 +757,24 @@
<xsl:value-of select="concat('[', ./gml:pos, ']')"/>-->
<xsl:text>
}
</xsl:text>
</geojson>
<location><xsl:value-of
select=
"concat(
number(substring-before(./gml:pos,' ')),
',',
number(substring-before(./gml:pos,' ')))"
/></location>
</xsl:if>
</xsl:for-each>
<!--
<xsl:for-each select="./gmd:temporalElement">
<te
mpora
lElement>
<xsl:for-each
select=
"./gmd:temporalElement"
>
<te
xtTempr
lElement>
<xsl:for-each
select=
".//gml:TimeInstant"
>
<xsl:text>
Instant in time
</xsl:text>
<xsl:if
test=
"./gml:timePosition[@indeterminatePosition]"
>
<xsl:value-of
select=
"./gml:timePosition/@indeterminatePosition"
/>
</xsl:if>
<xsl:value-of
select=
"./gml:timePosition"
/>
</xsl:for-each>
<xsl:for-each
select=
".//gml:TimePeriod"
>
<xsl:text>
F
rom</xsl:text>
<xsl:text>
Time period f
rom
</xsl:text>
<xsl:if
test=
"./gml:beginPosition[@indeterminatePosition]"
>
<xsl:value-of
select=
"./gml:beginPosition/@indeterminatePosition"
/>
</xsl:if>
...
...
@@ -780,7 +785,7 @@
</xsl:if>
<xsl:value-of
select=
"./gml:endPosition"
/>
</xsl:for-each>
</te
mpora
lElement>
</te
xtTempr
lElement>
</xsl:for-each>
-->
</xsl:for-each>
...
...
@@ -1068,7 +1073,9 @@
select=
"replace(*[1]/gmd:role/*/@codeListValue, '\s', '')"
as=
"xs:string?"
/>
<xsl:variable
name=
"emailAddress"
select=
"*[1]/gmd:contactInfo[1]/gmd:CI_Contact[1]/gmd:address[1]/gmd:CI_Address[1]/gmd:electronicMailAddress[1]/(gco:CharacterString|gmx:Anchor)"
as=
"xs:string*"
/>
<xsl:variable
name=
"phone"
select=
"*[1]/gmd:contactInfo[1]/gmd:CI_Contact[1]/gmd:phone[1]/gmd:CI_Telephone[1]/gmd:voice[1]/(gco:CharacterString|gmx:Anchor)"
as=
"xs:string*"
/>
<xsl:variable
name=
"instructions"
select=
"*[1]/gmd:contactInfo[1]/gmd:CI_Contact[1]/gmd:contactInstructions[1]/(gco:CharacterString|gmx:Anchor)"
as=
"xs:string*"
/>
<!--<xsl:if test="normalize-space($organisationName) != ''">-->
<xsl:element
name=
"Org{$fieldSuffix}"
>
<xsl:value-of
select=
"$organisationName"
/>
...
...
@@ -1084,16 +1091,24 @@
<xsl:element
name=
"Email{$fieldSuffix}"
>
<xsl:value-of
select=
"$emailAddress"
/>
</xsl:element>
<xsl:element
name=
"Phone{$fieldSuffix}"
>
<xsl:value-of
select=
"$phone"
/>
</xsl:element>
<xsl:element
name=
"Instructions{$fieldSuffix}"
>
<xsl:value-of
select=
"$instructions"
/>
</xsl:element>
<!--</xsl:if>-->
<xsl:choose>
<xsl:when
test=
"normalize-space($organisationName) != '' and normalize-space($individualName) != '' and normalize-space($emailAddress) != ''"
>
<!--
<xsl:choose>
<xsl:when test="normalize-space($organisationName) != '' and normalize-space($individualName) != '' and normalize-space($emailAddress) != ''">
-->
<xsl:element
name=
"contact{$fieldSuffix}"
>
{
"person":"
<xsl:value-of
select=
"replace($individualName, '"', '\\"')"
/>
",
"org":"
<xsl:value-of
select=
"replace($organisationName, '"', '\\"')"
/>
",
"role":"
<xsl:value-of
select=
"$role"
/>
",
"email":"
<xsl:value-of
select=
"$emailAddress"
/>
"
"email":"
<xsl:value-of
select=
"$emailAddress"
/>
",
"phone":"
<xsl:value-of
select=
"$phone"
/>
",
"instructions":"
<xsl:value-of
select=
"$instructions"
/>
"
}
</xsl:element>
</xsl:when>
<!--
</xsl:when>
<xsl:when test="normalize-space($organisationName) != '' and normalize-space($individualName) = '' and normalize-space($emailAddress) != ''">
<xsl:element name="contact{$fieldSuffix}">{
"org":"<xsl:value-of select="replace($organisationName, '"', '\\"')"/>",
...
...
@@ -1127,6 +1142,6 @@
"role":"<xsl:value-of select="$role"/>"
}</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
-->
</xsl:template>
</xsl:stylesheet>
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