Skip to content

Commit

Permalink
fix(converter): properly write and read spatial extents in XML
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Aug 26, 2024
1 parent 19e5b47 commit 321ae56
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,6 @@ Cette section contient des *caractères internationaux* (ainsi que des "caractè
<gmd:description>
<gco:CharacterString>Emprise géographique d'Avrigny</gco:CharacterString>
</gmd:description>
<gmd:geographicElement>
<gmd:EX_GeographicBoundingBox>
<gmd:westBoundLongitude>
<gco:Decimal>2.5587</gco:Decimal>
</gmd:westBoundLongitude>
<gmd:eastBoundLongitude>
<gco:Decimal>2.5934</gco:Decimal>
</gmd:eastBoundLongitude>
<gmd:southBoundLatitude>
<gco:Decimal>49.3677</gco:Decimal>
</gmd:southBoundLatitude>
<gmd:northBoundLatitude>
<gco:Decimal>49.4051</gco:Decimal>
</gmd:northBoundLatitude>
</gmd:EX_GeographicBoundingBox>
</gmd:geographicElement>
<gmd:temporalElement>
<gmd:EX_TemporalExtent>
<gmd:extent>
Expand All @@ -169,6 +153,31 @@ Cette section contient des *caractères internationaux* (ainsi que des "caractè
</gmd:extent>
</gmd:EX_TemporalExtent>
</gmd:temporalElement>
<gmd:geographicElement>
<gmd:EX_GeographicBoundingBox>
<gmd:westBoundLongitude>
<gco:Decimal>-11.5</gco:Decimal>
</gmd:westBoundLongitude>
<gmd:eastBoundLongitude>
<gco:Decimal>43.2</gco:Decimal>
</gmd:eastBoundLongitude>
<gmd:southBoundLatitude>
<gco:Decimal>35.3</gco:Decimal>
</gmd:southBoundLatitude>
<gmd:northBoundLatitude>
<gco:Decimal>81.4</gco:Decimal>
</gmd:northBoundLatitude>
</gmd:EX_GeographicBoundingBox>
<gmd:EX_GeographicDescription>
<gmd:geographicIdentifier>
<gmd:MD_Identifier>
<gmd:code>
<gco:CharacterString>http://www.naturalearthdata.com/ne_admin#Continent/Europe</gco:CharacterString>
</gmd:code>
</gmd:MD_Identifier>
</gmd:geographicIdentifier>
</gmd:EX_GeographicDescription>
</gmd:geographicElement>
</gmd:EX_Extent>
</gmd:extent>
<gmd:pointOfContact>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,6 @@ Cette section contient des *caractères internationaux* (ainsi que des "caractè
<gex:description>
<gco:CharacterString>Région wallonne</gco:CharacterString>
</gex:description>
<gex:geographicElement>
<gex:EX_GeographicBoundingBox>
<gex:westBoundLongitude>
<gco:Decimal>2.75</gco:Decimal>
</gex:westBoundLongitude>
<gex:eastBoundLongitude>
<gco:Decimal>6.50</gco:Decimal>
</gex:eastBoundLongitude>
<gex:southBoundLatitude>
<gco:Decimal>49.45</gco:Decimal>
</gex:southBoundLatitude>
<gex:northBoundLatitude>
<gco:Decimal>50.85</gco:Decimal>
</gex:northBoundLatitude>
</gex:EX_GeographicBoundingBox>
</gex:geographicElement>
<mdb:temporalElement>
<mdb:EX_TemporalExtent>
<mdb:extent>
Expand All @@ -209,6 +193,31 @@ Cette section contient des *caractères internationaux* (ainsi que des "caractè
</mdb:extent>
</mdb:EX_TemporalExtent>
</mdb:temporalElement>
<mdb:geographicElement>
<mdb:EX_GeographicBoundingBox>
<mdb:westBoundLongitude>
<gco:Decimal>-11.5</gco:Decimal>
</mdb:westBoundLongitude>
<mdb:eastBoundLongitude>
<gco:Decimal>43.2</gco:Decimal>
</mdb:eastBoundLongitude>
<mdb:southBoundLatitude>
<gco:Decimal>35.3</gco:Decimal>
</mdb:southBoundLatitude>
<mdb:northBoundLatitude>
<gco:Decimal>81.4</gco:Decimal>
</mdb:northBoundLatitude>
</mdb:EX_GeographicBoundingBox>
<mdb:EX_GeographicDescription>
<mdb:geographicIdentifier>
<mcc:MD_Identifier>
<mcc:code>
<gco:CharacterString>http://www.naturalearthdata.com/ne_admin#Continent/Europe</gco:CharacterString>
</mcc:code>
</mcc:MD_Identifier>
</mdb:geographicIdentifier>
</mdb:EX_GeographicDescription>
</mdb:geographicElement>
</gex:EX_Extent>
</mri:extent>
<mri:resourceMaintenance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,31 @@ Cette section contient des *caractères internationaux* (ainsi que des "caractè
</mdb:extent>
</mdb:EX_TemporalExtent>
</mdb:temporalElement>
<mdb:geographicElement>
<mdb:EX_GeographicBoundingBox>
<mdb:westBoundLongitude>
<gco:Decimal>-11.5</gco:Decimal>
</mdb:westBoundLongitude>
<mdb:eastBoundLongitude>
<gco:Decimal>43.2</gco:Decimal>
</mdb:eastBoundLongitude>
<mdb:southBoundLatitude>
<gco:Decimal>35.3</gco:Decimal>
</mdb:southBoundLatitude>
<mdb:northBoundLatitude>
<gco:Decimal>81.4</gco:Decimal>
</mdb:northBoundLatitude>
</mdb:EX_GeographicBoundingBox>
<mdb:EX_GeographicDescription>
<mdb:geographicIdentifier>
<mcc:MD_Identifier>
<mcc:code>
<gco:CharacterString>http://www.naturalearthdata.com/ne_admin#Continent/Europe</gco:CharacterString>
</mcc:code>
</mcc:MD_Identifier>
</mdb:geographicIdentifier>
</mdb:EX_GeographicDescription>
</mdb:geographicElement>
</mdb:EX_Extent>
</mdb:extent>
</mri:MD_DataIdentification>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,31 @@ Cette section contient des *caractères internationaux* (ainsi que des "caractè
</gmd:extent>
</gmd:EX_TemporalExtent>
</gmd:temporalElement>
<gmd:geographicElement>
<gmd:EX_GeographicBoundingBox>
<gmd:westBoundLongitude>
<gco:Decimal>-11.5</gco:Decimal>
</gmd:westBoundLongitude>
<gmd:eastBoundLongitude>
<gco:Decimal>43.2</gco:Decimal>
</gmd:eastBoundLongitude>
<gmd:southBoundLatitude>
<gco:Decimal>35.3</gco:Decimal>
</gmd:southBoundLatitude>
<gmd:northBoundLatitude>
<gco:Decimal>81.4</gco:Decimal>
</gmd:northBoundLatitude>
</gmd:EX_GeographicBoundingBox>
<gmd:EX_GeographicDescription>
<gmd:geographicIdentifier>
<gmd:MD_Identifier>
<gmd:code>
<gco:CharacterString>http://www.naturalearthdata.com/ne_admin#Continent/Europe</gco:CharacterString>
</gmd:code>
</gmd:MD_Identifier>
</gmd:geographicIdentifier>
</gmd:EX_GeographicDescription>
</gmd:geographicElement>
</gmd:EX_Extent>
</gmd:extent>
</gmd:MD_DataIdentification>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@ As such, **it is not very interesting at all.**`,
text: 'Contains sensitive information related to national defense',
},
],
spatialExtents: [],
spatialExtents: [
{
bbox: [-11.5, 35.3, 43.2, 81.4],
description: 'http://www.naturalearthdata.com/ne_admin#Continent/Europe',
},
],
temporalExtents: [
{
start: new Date('2024-05-24'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class Iso19139Converter extends BaseConverter<string> {
distributions: writeDistributions,
onlineResources: writeOnlineResources,
temporalExtents: writeTemporalExtents,
spatialExtents: () => writeSpatialExtents,
spatialExtents: writeSpatialExtents,
// TODO
extras: () => undefined,
landingPage: () => undefined,
Expand Down Expand Up @@ -317,6 +317,8 @@ export class Iso19139Converter extends BaseConverter<string> {
fieldChanged('overviews') && this.writers['overviews'](record, rootEl)
fieldChanged('temporalExtents') &&
this.writers['temporalExtents'](record, rootEl)
fieldChanged('spatialExtents') &&
this.writers['spatialExtents'](record, rootEl)
fieldChanged('distributions') &&
this.writers['distributions'](record, rootEl)
fieldChanged('lineage') && this.writers['lineage'](record, rootEl)
Expand Down

0 comments on commit 321ae56

Please sign in to comment.