INSPIRE-MIF / caniuse

Which INSPIRE GML and GeoJSON features can I use in which software?
5 stars 8 forks source link

Test for 3D coordinates in GML #12

Open heidivanparys opened 5 years ago

heidivanparys commented 5 years ago

Regarding the test for 3D coordinates in GML: I would like to suggest to split the test into two, so that the following 2 scenarios are checked:

  1. only srsName present
  2. srsName and srsDimension present

See the following tests with ogrinfo:

<gml:FeatureCollection
  xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3"
  xmlns:gml="http://www.opengis.net/gml/3.2"
  xmlns:tn="http://inspire.ec.europa.eu/schemas/tn/4.0"
  xmlns:net="http://inspire.ec.europa.eu/schemas/net/4.0"
  xmlns:tn-ra="http://inspire.ec.europa.eu/schemas/tn-ra/4.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://inspire.ec.europa.eu/schemas/base/3.3 http://inspire.ec.europa.eu/schemas/base/3.3/BaseTypes.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://inspire.ec.europa.eu/schemas/tn/4.0 http://inspire.ec.europa.eu/schemas/tn/4.0/CommonTransportElements.xsd http://inspire.ec.europa.eu/schemas/net/4.0 http://inspire.ec.europa.eu/schemas/net/4.0/Network.xsd http://inspire.ec.europa.eu/schemas/tn-ra/4.0 http://inspire.ec.europa.eu/schemas/tn-ra/4.0/RailwayTransportNetwork.xsd"
  gml:id="id.example.2D.25832.no.srsDimension">
 <gml:featureMember>
  <tn-ra:RailwayLink gml:id="dk.tn-ra.1087552517">
   <net:beginLifespanVersion>2015-11-27T14:27:31</net:beginLifespanVersion>
   <net:inspireId>
    <base:Identifier>
     <base:localId>1087552517</base:localId>
     <base:namespace>http://data.gov.dk/inspire-tn-ra</base:namespace>
    </base:Identifier>
   </net:inspireId>
   <net:inNetwork xsi:nil="true" nilReason="other:unpopulated"/>
   <net:centrelineGeometry>
    <gml:LineString gml:id="id-bceb10c8-329c-4d2b-af3d-b7a0a18dc410-0" srsName="http://www.opengis.net/def/crs/EPSG/0/25832">
     <gml:posList>711530.29 6190097.44 711518.28 6190116.1</gml:posList>
    </gml:LineString>
   </net:centrelineGeometry>
   <net:fictitious>false</net:fictitious>
   <tn:geographicalName xsi:nil="true" nilReason="other:unpopulated"/>
   <tn:validFrom>2015-11-27T14:27:31</tn:validFrom>
  </tn-ra:RailwayLink>
 </gml:featureMember>
 </gml:FeatureCollection>

Correct result: LINESTRING (711530.29 6190097.44,711518.28 6190116.1)

<gml:FeatureCollection
  xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3"
  xmlns:gml="http://www.opengis.net/gml/3.2"
  xmlns:tn="http://inspire.ec.europa.eu/schemas/tn/4.0"
  xmlns:net="http://inspire.ec.europa.eu/schemas/net/4.0"
  xmlns:tn-ra="http://inspire.ec.europa.eu/schemas/tn-ra/4.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://inspire.ec.europa.eu/schemas/base/3.3 http://inspire.ec.europa.eu/schemas/base/3.3/BaseTypes.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://inspire.ec.europa.eu/schemas/tn/4.0 http://inspire.ec.europa.eu/schemas/tn/4.0/CommonTransportElements.xsd http://inspire.ec.europa.eu/schemas/net/4.0 http://inspire.ec.europa.eu/schemas/net/4.0/Network.xsd http://inspire.ec.europa.eu/schemas/tn-ra/4.0 http://inspire.ec.europa.eu/schemas/tn-ra/4.0/RailwayTransportNetwork.xsd"
  gml:id="id.example.2.5D.7416.srsDimension">
 <gml:featureMember>
  <tn-ra:RailwayLink gml:id="dk.tn-ra.1087552517">
   <net:beginLifespanVersion>2015-11-27T14:27:31</net:beginLifespanVersion>
   <net:inspireId>
    <base:Identifier>
     <base:localId>1087552517</base:localId>
     <base:namespace>http://data.gov.dk/inspire-tn-ra</base:namespace>
    </base:Identifier>
   </net:inspireId>
   <net:inNetwork xsi:nil="true" nilReason="other:unpopulated"/>
   <net:centrelineGeometry>
    <gml:LineString gml:id="id-bceb10c8-329c-4d2b-af3d-b7a0a18dc410-0" srsName="http://www.opengis.net/def/crs/EPSG/0/7416" srsDimension="3">
     <gml:posList>711530.29 6190097.44 31.24 711518.28 6190116.1 31.27</gml:posList>
    </gml:LineString>
   </net:centrelineGeometry>
   <net:fictitious>false</net:fictitious>
   <tn:geographicalName xsi:nil="true" nilReason="other:unpopulated"/>
   <tn:validFrom>2015-11-27T14:27:31</tn:validFrom>
  </tn-ra:RailwayLink>
 </gml:featureMember>
 </gml:FeatureCollection>

Correct result: LINESTRING Z (711530.29 6190097.44 31.24,711518.28 6190116.1 31.27)

<gml:FeatureCollection
  xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3"
  xmlns:gml="http://www.opengis.net/gml/3.2"
  xmlns:tn="http://inspire.ec.europa.eu/schemas/tn/4.0"
  xmlns:net="http://inspire.ec.europa.eu/schemas/net/4.0"
  xmlns:tn-ra="http://inspire.ec.europa.eu/schemas/tn-ra/4.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://inspire.ec.europa.eu/schemas/base/3.3 http://inspire.ec.europa.eu/schemas/base/3.3/BaseTypes.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://inspire.ec.europa.eu/schemas/tn/4.0 http://inspire.ec.europa.eu/schemas/tn/4.0/CommonTransportElements.xsd http://inspire.ec.europa.eu/schemas/net/4.0 http://inspire.ec.europa.eu/schemas/net/4.0/Network.xsd http://inspire.ec.europa.eu/schemas/tn-ra/4.0 http://inspire.ec.europa.eu/schemas/tn-ra/4.0/RailwayTransportNetwork.xsd"
  gml:id="id.example.2.5D.7416.no.srsDimension">
  <gml:featureMember>
  <tn-ra:RailwayLink gml:id="dk.tn-ra.1087552517">
   <net:beginLifespanVersion>2015-11-27T14:27:31</net:beginLifespanVersion>
   <net:inspireId>
    <base:Identifier>
     <base:localId>1087552517</base:localId>
     <base:namespace>http://data.gov.dk/inspire-tn-ra</base:namespace>
    </base:Identifier>
   </net:inspireId>
   <net:inNetwork xsi:nil="true" nilReason="other:unpopulated"/>
   <net:centrelineGeometry>
    <gml:LineString gml:id="id-bceb10c8-329c-4d2b-af3d-b7a0a18dc410-0" srsName="http://www.opengis.net/def/crs/EPSG/0/7416">
     <gml:posList>711530.29 6190097.44 31.24 711518.28 6190116.1 31.27</gml:posList>
    </gml:LineString>
   </net:centrelineGeometry>
   <net:fictitious>false</net:fictitious>
   <tn:geographicalName xsi:nil="true" nilReason="other:unpopulated"/>
   <tn:validFrom>2015-11-27T14:27:31</tn:validFrom>
  </tn-ra:RailwayLink>
 </gml:featureMember>
 </gml:FeatureCollection>

Incorrect result!: LINESTRING (711530.29 6190097.44,31.24 711518.28,6190116.1 31.27)

The expected result is LINESTRING Z (711530.29 6190097.44 31.24,711518.28 6190116.1 31.27).

sMorrone commented 5 years ago

Indeed the issue is present for lines and polygons. Conversely, point geometries are correctly recognised as 'POINTZ' no matter the srsDimension attribute is specified or not. New test cases have been uploaded for 3d points, poly and lines in the canIuse repository. The test results have been updated accordingly.