Bug report #16943
Create virtual layer from OSM import fails on field names with : in them
|Affected QGIS version:||2.18.11||Regression?:||No|
|Operating System:||Ubuntu||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||24842|
Some OSM layers created in spatialite (using built in Vector/OSM menu) have colons in the field name. When trying to create virtual layers either with or without effected fields, an error is returned as such:
Query execution error on DROP TABLE IF EXISTS "rottnest_workshop_polygons"; CREATE VIRTUAL TABLE "rottnest_workshop_polygons" USING QgsVLayer(rottnest_workshop_polygons20170729144756312);: 1 - near ":disposal": syntax error
In this case, where ":disposal" is the remainder of the column name "toilets:disposal".
It is possible to change the column name as a temporary work around, but I'm trying to create a repeatable process where we can update with a fresh copy of the underlying OSM data and have all existing styling/layers etc "just work".
Has been checked on 2.14, 2.18.10 & 2.18.11.
Attached osm data file has tags that create such fields.