OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.84k stars 2.53k forks source link

Class with several geometry attributes in INTERLIS 2 Transferfiles #6612

Open janineru opened 1 year ago

janineru commented 1 year ago

Expected behavior and actual behavior.

If an INTERLIS 2 Transferfile contains a class with several geometry attributes, only one geometry is visualized.

Possible Solution: Visualization of all geometries, e.g. by generating a layer for each geometry (example below). It is suggested, that all attributes should be with all geometries to allow user choice to delete one layer, or provide all attributes for styling. Moreover, for consistency reasons, it could be considered to add the geom attribute to the name of all layers of INTERLIS 2 Transferfiles (also to those layers with only one geometry).

Steps to reproduce the problem.

The test data set is based on the VSADSSMINI_2020_LV95 data model. The node class has two geometries in the mini model, 'Lage' and 'Detailgeometrie'. When imported in QGIS, the layer VSADSSMINI_2020_LV95.VSADSSMini.Knoten is added with the geometry of the attribute 'Lage', the 'Detailgeometrie' is not shown. (Observation: In the example XTF, 'Lage' comes after 'Detailgeometry', which may imply that points are chosen over polygons.)

Possible Solution: Import two layers: VSADSSMINI_2020_LV95.VSADSSMini.Knoten.Detailgeometrie and VSADSSMINI_2020_LV95.VSADSSMini.Knoten.Lage

Excerpt from data model VSADSSMINI_2020_LV95:

CLASS Knoten EXTENDS VSA_BaseClass =  
  ATTRIBUTE
…
Detailgeometrie: Base_LV95.Surface;
…
Lage: Base_LV95.LKoord;
…
END Knoten;

Excerpt from data model Base_LV95:

LKoord = COORD 2480000.000 .. 2840000.000 [m], !!{CHLV95/1}, 
                   170000.000 .. 1300000.000 [m],  !!{CHLV95/2},
                   ROTATION 2 -> 1;

!! neu 23.5.2012    
!!    Surface = SURFACE WITH (STRAIGHTS, ARCS) VERTEX LKoord WITHOUT OVERLAPS > 0.000;  !! Einzelflächen
    Surface = SURFACE WITH (STRAIGHTS, ARCS) VERTEX LKoord WITHOUT OVERLAPS > 0.050;  !! Einzelflächen

Excerpt from the test dataset:

<?xml version="1.0" encoding="UTF-8" ?>
<TRANSFER xmlns="http://www.interlis.ch/INTERLIS2.3">
  <HEADERSECTION VERSION="2.3" SENDER="UNKNOWN">
    <MODELS>
      <MODEL NAME="VSADSSMINI_2020_LV95" URI="http://www.infogrips.ch" VERSION="" />
    </MODELS>
    <ALIAS>
      <ENTRIES FOR="VSADSSMINI_2020_LV95">
      </ENTRIES>
    </ALIAS>
    <COMMENT>
      dataset generated by xtfout version 1.4, (c) infoGrips GmbH 2005-2018
    </COMMENT>
  </HEADERSECTION>
  <DATASECTION>
    <VSADSSMINI_2020_LV95.VSADSSMini BID="BASKET1">
      <VSADSSMINI_2020_LV95.VSADSSMini.Knoten TID="B16BFF28-E032-4517-8F47-B36B550ADF0B">
        <Letzte_Aenderung>20211209</Letzte_Aenderung>
        <DatenherrRef REF="ch20p3q400000002"></DatenherrRef>
        <DatenlieferantRef REF="ch20p3q400000002"></DatenlieferantRef>
        <Bezeichnung>B_45106</Bezeichnung>
        <Detailgeometrie>
          <SURFACE>
            <BOUNDARY>
              <POLYLINE>
                <COORD><C1>2670093.850</C1><C2>1206847.292</C2></COORD>
                <COORD><C1>2670093.105</C1><C2>1206847.835</C2></COORD>
                <COORD><C1>2670078.739</C1><C2>1206858.308</C2></COORD>
                <COORD><C1>2670077.200</C1><C2>1206859.430</C2></COORD>
                <COORD><C1>2670081.598</C1><C2>1206865.464</C2></COORD>
                <COORD><C1>2670088.308</C1><C2>1206860.579</C2></COORD>
                <COORD><C1>2670097.637</C1><C2>1206853.785</C2></COORD>
                <COORD><C1>2670098.252</C1><C2>1206853.338</C2></COORD>
                <COORD><C1>2670093.850</C1><C2>1206847.292</C2></COORD>
              </POLYLINE>
            </BOUNDARY>
          </SURFACE>
        </Detailgeometrie>
        <Funktion>Regenbecken_Fangbecken</Funktion>
        <Finanzierung>privat</Finanzierung>
        <FunktionHierarchisch>SAA</FunktionHierarchisch>
        <Lage>
          <COORD><C1>2704426.415</C1><C2>1269201.243</C2></COORD>
        </Lage>
        <Lagegenauigkeit>unbekannt</Lagegenauigkeit>
        <Nutzungsart_Ist>Niederschlagsabwasser</Nutzungsart_Ist>
        <OBJ_ID_Abwasserbauwerk>C43FCA39-FC4F-4DFE-9327-AFADBD13EA79</OBJ_ID_Abwasserbauwerk>
        <Status>in_Betrieb</Status>
        <EigentuemerRef REF="ch20p3q400000001"></EigentuemerRef>

Operating system

Windows 10 Enterprise 64-Bit

GDAL version and provenance

QGIS 3.28.0 'Firenze' and QGIS 3.22.12 'Białowieża'

rouault commented 1 year ago

CC @pka

pka commented 1 year ago

The GDAL geometry model does support multiple geometry columns, so it would be possible to support that in the driver and QGIS would you let choose the geometry column.

The Interlis driver is on a minimal maintenance level from my side, since all official support goes into https://github.com/claeis/ili2db and https://github.com/opengisch/QgisModelBaker which is based on ili2db. So improvments like this only happens if someone really needs it and is willing to sponsor the work on it.