Bug report #9833

KML files: partly editable, but newly added feature not visible untill reloading file

Added by Richard Duivenvoorde over 10 years ago. Updated over 5 years ago.

Affected QGIS version:2.2.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:18364


I have a KML file here, containing ONE big (gpx I think) line.

A windows users told me that QGIS is showing it was not editable ('edit'-pencil disabled). But with me on Linux (both 2.2 and current testing) the 'pencil' tool is active, and seems I can edit the layer.

After enabling edit, I can only add a new line (not edit the available line with the node tool).
Strange, but ok. Then I add a new line, all seems ok, but when I toggle edit mode OFF the line is not visible anymore.
BUT when I remove the kml layer (all in the same project), and add it again as layer, my newly (former invisible) line is available and visible.

This happens both in master and testing (clean 4326 project, no OTF).

Not sure if this is a bug, to me it seems that
- either editing KML should not be allowed (because a KML can contain styling which probably get's lost when you save it in QGIS) then the Windows apparently sees what he needs to see (though maybe a warning/message would be nice somewhere?),
- OR it should behave in the same way as normal vector editing,
- OR it should maybe warn me that I'm starting to edit a KML file and loosing styling, but then a newly added feature should stay visibible after addition.

To reproduce: load attached KML file and steps above.

doc.kml - kml file to test (21 KB) Richard Duivenvoorde, 2014-03-22 05:30 PM


#1 Updated by Richard Duivenvoorde about 10 years ago

  • Assignee set to Jürgen Fischer

We had a look into it. It appears that OGR has two KML drivers: KML and LIBKML


drv_kml CANNOT edit at all
drv_libkml CAN only change new features (not edit excisting ones)

On windows you probably have drv_kml.
On linux you can have both in ogr (I have: see ogrinfo -- formats).

You can temporarily disable one driver by setting an environment var:

and then run qgis from that environment

So if you are on windows you cannot edit anyway.
If you are on linux, you can add new features, but there also seems to be something with the attribute creation.

#2 Updated by Giovanni Manghi about 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#3 Updated by Jürgen Fischer almost 7 years ago

  • Assignee deleted (Jürgen Fischer)

#4 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF