Bug report #21544

DB Manager cannot import anymore from GeoJSON into a Spatialite table

Added by Yannis Psomadakis over 1 year ago. Updated over 1 year ago.

Category:DB Manager
Affected QGIS version:3.6.0 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29360


When importing a GeoJSON table into a Spatialite table in 3.4.2-Madeira, the name of the imported table appears in the 'Output table' field and imports as expected.
From versions 3.5 onward, the imported table defaults into one of the existing tables and imports data from that table instead of the GeoJSON file regardless of manually changing the name to the one matching the GeoJSON file.
Steps to reproduce:
a) Create a geojson file from contents below: {
"type": "FeatureCollection",
"name": "venue-levels",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [ { "type": "Feature", "properties": { "id": 1, "level_id": 0, "floor_name": "Ground Floor", "table_name": "", "elevation_a0f": 0, "description": "ground floor plan", "floor_short_code": "F0" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -1.2, 52.2 ], [ 0, 52.4], [ 1.2, 52.2 ],[ -1.2, 52.2 ] ] ] ] } }

b) Create a Spatialite database with 2-3 other tables
c) Use the DB Manager "Import Layer/File"
d) Click the ellipsis, locate file you created and open it. The 'input' field should change from a table name into the path of the selected file.
e) In versions 3.5 and beyond, the 'Output table' Table field defaults o an existing table and does not change into the name as listed in the file which in this example is "venue-levels".
f) Confirm the Primary key, geometry, choose to replace (if exists) and click OK
The imported table now shows the contents of the table that was in the 'Output table' Table field beforehand.

Related issues

Related to QGIS Application - Bug report #22033: DB Manger imports the wrong data Closed 2019-05-09


#1 Updated by Giovanni Manghi over 1 year ago

  • Subject changed from DB Manager cannot import from GeoJSON into a Spatialite table to DB Manager cannot import anymore from GeoJSON into a Spatialite table
  • Operating System deleted (Windows 10)
  • Affected QGIS version changed from 3.4.5 to 3.6.0
  • Priority changed from Normal to High

Confirmed also on 3.6

#2 Updated by Alexander Bruy over 1 year ago

Probably the same as #22033

#3 Updated by Alexander Bruy over 1 year ago

#4 Updated by Alexander Bruy over 1 year ago

  • Status changed from Open to Feedback

#5 Updated by Alessandro Pasotti over 1 year ago

Yes, it looks like the same bug

Also available in: Atom PDF