Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import 3D vector into Spatialite datasource (works for GPKG) #33883

Closed
gioman opened this issue Jan 17, 2020 · 0 comments · Fixed by #33938
Closed

Cannot import 3D vector into Spatialite datasource (works for GPKG) #33883

gioman opened this issue Jan 17, 2020 · 0 comments · Fixed by #33938
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers

Comments

@gioman
Copy link
Contributor

gioman commented Jan 17, 2020

QGIS 3.10.1/master on Windows/Linux

The following affects both the QGIS Browser and DB Manager.

Create an empty Spatialite datasource add create a connection to it

Pick a 3D shapefile like https://github.com/qgis/QGIS/files/4060140/zone_omi_dati.Bari.zip (unzip it)

Try import the above vector into the Spatialite datasource by drag & drop in the QGIS browser or DB manager

The results will always be a message like "Failed to import layer! Loading of layer failed" and an empty geometryless table is created inside the Spatialite source.

The same operation using a GPKG datasource works fine.

Notes:
using OGR2OGR a direct import into an existing Spatialite datasource also fails, i.e.

ogr2ogr -f SQLITE test1.sqlite zone_omi.shp  -update

ERROR 1: Cannot insert feature with geometry of type MULTIPOLYGONZ in column GEOMETRY. Type POLYGONZ expected

what works is

ogr2ogr -f SQLITE teste1.sqlite zone_omi.shp -update -nlt MULTIPOLYGONZ

or

ogr2ogr -f SQLITE teste1.sqlite zone_omi.shp -update -nlt POLYGONZ

@gioman gioman added Data Provider Related to specific vector, raster or mesh data providers Bug Either a bug report, or a bug fix. Let's hope for the latter! labels Jan 17, 2020
@rouault rouault self-assigned this Jan 20, 2020
rouault added a commit to rouault/QGIS that referenced this issue Jan 21, 2020
Fixes qgis#33883

- QgsOgrProvider::wkbType(): autopromote Z/M/ZM linestring/polygon to multi
- QgsVectorLayerExporter::exportLayer(): remove unneeded hack for shapefile
- QgsSpatiaLiteProvider::createEmptyLayer(): deal with xxxZ geometry types
  (refs #qgis/qgis4.0_api#107)
nyalldawson pushed a commit that referenced this issue Jan 21, 2020
Fixes #33883

- QgsOgrProvider::wkbType(): autopromote Z/M/ZM linestring/polygon to multi
- QgsVectorLayerExporter::exportLayer(): remove unneeded hack for shapefile
- QgsSpatiaLiteProvider::createEmptyLayer(): deal with xxxZ geometry types
  (refs #qgis/qgis4.0_api#107)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants