[gdal-dev] does OGR GML support multiple geometries

lucvanlinden luc.vanlinden at gmail.com
Tue Nov 24 05:36:37 PST 2015


Hi 

Tested 1.11 2.0beta of OGR (have no binaries at hand for latest stabble
2.X).

Trying to use gml with multiple geometries. Here is some simplified
testcase.

testMydualGeom.xsd:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:gmlsf="http://www.opengis.net/gmlsf"
  xmlns:test="http://www.test.org/test"
  targetNamespace="http://www.test.org/test"
  elementFormDefault="qualified"
  version="0.1.0">

  
  <xsd:import
    namespace="http://www.w3.org/XML/1998/namespace"
    schemaLocation="http://www.w3.org/2001/xml.xsd"/>
  <xsd:import
    namespace="http://www.opengis.net/gml"
   
schemaLocation="http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd"/>
  <xsd:import
    namespace="http://www.opengis.net/gmlsf"
   
schemaLocation="http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsfLevels.xsd"/>


  
  <xsd:element
    name="MyDualGeomFeature"
    type="test:MyDualGeomFeature"
    substitutionGroup="gml:_Feature"/>

  <xsd:complexType name="MyDualGeomFeatureType">
    <xsd:complexContent>
      <xsd:extension base="gml:AbstractFeatureType">
        <xsd:sequence>
          <xsd:element name="componentID"
            type="xsd:string"
            minOccurs="0"
            maxOccurs="1"/>
          <xsd:element name="centerline"
            type="gml:CurvePropertyType"
            minOccurs="0"
            maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>
                The centerline spatial geometry of this component as it was
installed.
              </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
          <xsd:element name="centerOf"
            type="gml:PointPropertyType"
            minOccurs="0"
            maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>
                The center point spatial geometry of this component as it
was installed.
              </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
 

</xsd:schema>

testMydualGeom.gml file:

<?xml version="1.0" encoding="UTF-8"?>

<gml:FeatureCollection xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns="http://www.test.org/test"
  xsi:schemaLocation="http://www.test.org testMydualgeom.xsd"
  gml:id="1">

   
  <gml:featureMember>
    <MyDualGeomFeature gml:id="myMyDualGeomFeature1">
		<componentID>test1</componentID>
      <centerline>
        <gml:Point gml:id="geom1" srsName="EPSG:4326">
          <gml:pos>30.095472861000076 -96.079962905999992</gml:pos>
        </gml:Point>
      </centerline>
      <centerOf>
        <gml:Point gml:id="geom2" srsName="EPSG:4326">
          <gml:pos>30.095472861000076 -96.079962905999992</gml:pos>
        </gml:Point>
      </centerOf>
    </MyDualGeomFeature>
  </gml:featureMember>
 

</gml:FeatureCollection>


Ogrinfo reports only one geometry. The gfs file has the following:
<GeometryType>1</GeometryType>

I know and succesfully tested the editing of the gfs file for getting the 2
geometries reckognised by Ogr.

My question, although reading http://www.gdal.org/drv_gml.html

"But, starting with OGR 1.11, if the .xsd schema is understood by the XSD
parser and declares several geometry fields, or the .gfs file declares
several geometry fields, multiple geometry fields will be reported by the
GML driver according to RFC 41."

I would have assumed the xsd would be read correctly to identify the 2
geometry fields.
(also included -oo XSD=testMydualGeom.xsd (for the 2.0beta release).

question is: is this working (ogr gml multiple geometries reading) in a
recent stable 2.X?

tx

Luc







--
View this message in context: http://osgeo-org.1560.x6.nabble.com/does-OGR-GML-support-multiple-geometries-tp5238267.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list