Bug report #21442

Missing source fields when loading vector data in format INTERLIS 2

Added by Stefan Henrich over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/OGR
Affected QGIS version:3.6.0 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:up/downstream
Crashes QGIS or corrupts data:No Copied to github as #:29259

Description

When loading vector data in INTERLIS 2 format (.xtf) and the first record is missing an attribute value (because it is optional according to the corresponding model (.ili)), no source field is generated in QGIS for this attribute.
For all subsequent records which have a corresponding attribute value in the data, this value is not available in QGIS.

Steps to reproduce:
1. Load attached file attribute_available.xtf into QGIS as a new layer.
2. Open Attribute Table of the created layer and recognize field named Breite.
3. Load attached file attribute_not_available.xtf into QGIS as a new layer.
4. Open Attribute Table of the created layer and recognize that the field named Breite is missing.

The only difference between the two datasets (which can be viewed with a text editor) is the order of the two records (line 5 and 6). In attribute_available the first record contains an XML tag <Breite> where as in the other file <Breite> is missing in the first record.

attribute_available.xtf (2.48 KB) Stefan Henrich, 2019-03-01 07:02 PM

attribute_not_available.xtf (2.48 KB) Stefan Henrich, 2019-03-01 07:02 PM

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

It is messing also using OGRINFO, so this is a OGR bug, agree?

giovanni@sibirica:~/Downloads$ ogrinfo -so attribute_not_available.xtf SIA405_LKMap.SIA405_LKMap.LKLinie
Warning 6: Failed to add new definition to existing layers, attributes not saved: Breite,
Had to open data source read-only.
INFO: Open of `attribute_not_available.xtf'
using driver `Interlis 2' successful.

Layer name: SIA405_LKMap.SIA405_LKMap.LKLinie
Geometry: Unknown (any)
Feature Count: 2
Extent: (2654496.235000, 1233335.396000) - (2656022.404000, 1233461.187000)
Layer SRS WKT:
(unknown)
TID: String (0.0)
OBJ_ID: String (0.0)
Datenherr: String (0.0)
Datenlieferant: String (0.0)
Letzte_Aenderung: String (0.0)
Eigentuemer: String (0.0)
Lagebestimmung: String (0.0)
Status: String (0.0)
Objektart: String (0.0)

giovanni@sibirica:~/Downloads$ ogrinfo -so attribute_available.xtf SIA405_LKMap.SIA405_LKMap.LKLinie
Had to open data source read-only.
INFO: Open of `attribute_available.xtf'
using driver `Interlis 2' successful.

Layer name: SIA405_LKMap.SIA405_LKMap.LKLinie
Geometry: Unknown (any)
Feature Count: 2
Extent: (2654496.235000, 1233335.396000) - (2656022.404000, 1233461.187000)
Layer SRS WKT:
(unknown)
TID: String (0.0)
OBJ_ID: String (0.0)
Datenherr: String (0.0)
Datenlieferant: String (0.0)
Letzte_Aenderung: String (0.0)
Eigentuemer: String (0.0)
Lagebestimmung: String (0.0)
Status: String (0.0)
Breite: String (0.0)
Objektart: String (0.0)

#2 Updated by Stefan Henrich over 5 years ago

I agree. I'm going to open an issue at https://github.com/OSGeo/gdal then.
Thanks

#4 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to up/downstream
  • Status changed from Feedback to Closed

Also available in: Atom PDF