Bug report #16480

Wrong number of attributes rows when opening a GML file

Added by Kai Borgolte over 4 years ago. Updated over 4 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Vectors
Affected QGIS version:2.18.6 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data:No Copied to github as #:24388

Description

I tried to follow [[http://docs.qgis.org/testing/en/docs/user_manual/introduction/getting_started.html#id8]] and opened lakes.gml from [[http://qgis.org/downloads/data/qgis_sample_data.zip]].

Labeling shows only one label, and the attribute table show only one feature from 15. As far as I understand the problem seems to be that in the gml file all features have identic fid="F0".

lakes-fixed.gml - fixed lakes.gml (276 KB) Richard Duivenvoorde, 2017-05-01 01:32 PM

History

#1 Updated by Richard Duivenvoorde over 4 years ago

  • Description updated (diff)
  • Regression? set to Yes

Confirmed here on 2.18 and current master, 2.14 is working as expected

One problem is that in the GML indeed every feature has F0 as fid, and QGIS sees them as one feature (when using the select tool or looking at the attribute table). The count features counts 15 though?..

if I do ogrinfo lakes.gml lakes it shows 15 features all with the same id: 0 and fid F0

OGRFeature(lakes):0
fid (String) = F0
cat (Integer) = 14
NAMES (String) = Becharof Lake
AREA_MI (Real) = 456

OGRFeature(lakes):0
fid (String) = F0
cat (Integer) = 15
NAMES (String) = Lower Ugashik Lake
AREA_MI (Real) = 160

this also could be considered a data issue though, not sure how strict gml is with it's fid...

#2 Updated by Giovanni Manghi over 4 years ago

  • Easy fix? set to No

#3 Updated by Giovanni Manghi over 4 years ago

  • Category changed from Documentation and Help to Translations and international
  • Priority changed from Normal to High
  • Subject changed from lakes.gml in sample data is faulty to Wrong number of attributes rows when opening a GML file

Could it be something that depends on the GDAL version used in different QGIS releases?

#4 Updated by Richard Duivenvoorde over 4 years ago

I compile 2.14, 2.18 and master all (currently) with GDAL 2.1.2. And only 2.14 is 'working'.

So, it is an actual data/qgis problem.

I discussed it here (Essen) with some dev's and it is because attribute table etc actuall uses the fid's (which are all the same).

Using:

ogr2ogr -oo EXPOSE_GML_ID=YES -f 'GML' lakes-fixed.gml lakes.gml

you can actually fix the data and make it work in QGIS.. I attached a fixed version, and will update the data.zip

#5 Updated by Giovanni Manghi over 4 years ago

  • Status changed from Open to Closed
  • Category changed from Translations and international to Vectors
  • Resolution set to wontfix

Also available in: Atom PDF