Opened 9 years ago

Closed 9 years ago

#6031 closed task (fixed)

Multiple feature geometry

Reported by: michalmed Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

GML files allows data producer to include more geometries within one feature (e.g. polygon of parcel and reference point inside the parcel). GDAL shall be able to recognize two geometries and support switching between them. I was testing it for GML 3.2.1 data harmonised with INSPIRE Data specification (version 3.0). When I download data from WFS service to QGIS (2.6.0 under windows 7, both 64-bit and 32-bit), it doesn't render at all. Under Ubuntu 14.04 in QGIS 2.6.0 it renders polygons. In older versions of GIS, all I had to do was overwrite geometryType attribute from 1 to 3 in automatically generated .gfs file. Yes, it's a bit complicated, but it worked. In QGIS 2.6.0 under Windows it doesn't work. Default value of geometryReference is '6' - multipolygon - but it doesn't render. After rewriting .gfs file, I got no geometry at all. If I want to get polygons, I have to download GML data and erase all referencePoint elements.

Change History (2)

comment:1 by Even Rouault, 9 years ago

Not clear at all from your description if it is a problem with QGIS or GDAL. Since GDAL 1.11, you should be able to get multiple geometry fields per feature. This may require adding several GeomPropertyDefn in the .gfs. Look for "Starting with OGR 1.11, the <GeometryElementPath> and <GeometryType> can be specified as many times as there are geometry fields in the GML file" in http://gdal.org/drv_gml.html

Last edited 9 years ago by Even Rouault (previous) (diff)

comment:2 by michalmed, 9 years ago

Resolution: fixed
Status: newclosed

OK, I tried to edit .gfs according to the link and it works fine, problem is on the QGIS side. No matter how many GeometryPropertyDefn element are included, geometry is rendered according to the first one.

    <Name>CadastralParcel</Name>
    <ElementPath>CadastralParcel</ElementPath>
    <GeomPropertyDefn>
      <Name>geometry</Name>
      <ElementPath>geometry</ElementPath>
      <GeometryType>3</GeometryType>
      <SRSName>EPSG:5514</SRSName>
    </GeomPropertyDefn>
    <GeomPropertyDefn>
      <Name>referencePoint</Name>
      <ElementPath>referencePoint</ElementPath>
      <GeometryType>1</GeometryType>
      <SRSName>EPSG:5514</SRSName>
    </GeomPropertyDefn>

In this case, polygons are rendered and if I want to have points, I have to switch order of GeomPropertyDefn elements and overwrite it manually. I'm closing this trac and opening new one in QGIS.

Note: See TracTickets for help on using tickets.