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

Saving as SpatiaLite fails with "save as" dialog when input is a multi geometry #18990

Closed
qgib opened this issue Jun 14, 2014 · 12 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats)

Comments

@qgib
Copy link
Contributor

qgib commented Jun 14, 2014

Author Name: Harry Clarke (@HarryEClarke)
Original Redmine Issue: 10584
Affected QGIS version: master
Redmine category:vectors


New description:

When trying to save a multipolygon shapefile to Spatialite using the "save as" dialog the operation fails. Actually the fail is by ogr2ogr. When using ogr2ogr from the command line it is enough to add

-nlt MULITPOLYGON

option, but in the "save as" dialog is not clear if such option can be added in the "custom options" of the same dialog.

The real issue seems that QGIS is not consistent, in fact importing into a Spatialite DB works fine for multigeometry input layers both using the Drag and Drop from the QGIS browser and using the import function of DB manager.

It also works ok using the "convert format" tool (based on ogr2ogr) of the processing toolbox (without needed to add manually any parameter).

It is not clear to me how that step made into the documentation as the very same issue affects QGIS down to 1.8 included (maybe in an earlier release it was ok).


Old Description:

On page 7 of the QGIS Training Manual, users are instructed to save the landuse layer as SpatialLite. In so doing, the following error was encountered, using the dataset as described in the training manual.

Export to vector file failed.
Error: Feature write errors:
Feature creation error (OGR error: sqlite3_step() failed:
landuse.GEOMETRY violates Geometry constraint [geom-type or SRID not allowed] (19))
Only 52 of 53 features written.

A file is created in the directory, but nothing is added to the map


Related issue(s): #19812 (relates), #19856 (relates), #20892 (relates)
Redmine related issue(s): 11542, 11597, 12796


@qgib
Copy link
Contributor Author

qgib commented Jun 14, 2014

Author Name: Giovanni Manghi (@gioman)


this one?

http://docs.qgis.org/2.2/pdf/en/QGIS-2.2-QGISTrainingManual-en.pdf


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jun 14, 2014

Author Name: Harry Clarke (@HarryEClarke)


Yes

@qgib
Copy link
Contributor Author

qgib commented Jun 16, 2014

Author Name: Giovanni Manghi (@gioman)


Harry Clarke wrote:

Yes

I cannot confirm in qgis master, can you check please?

@qgib
Copy link
Contributor Author

qgib commented Jun 23, 2014

Author Name: Jürgen Fischer (@jef-n)


  • category_id was configured as Documentation and Help

@qgib
Copy link
Contributor Author

qgib commented Jun 23, 2014

Author Name: Paolo Cavallini (@pcav)


  • subject was changed from Saving SpatialLite fails to Saving SpatiaLite fails

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2014

Author Name: Giovanni Manghi (@gioman)


Closing for lack of feedback.


  • status_id was changed from Feedback to Closed
  • resolution was changed from to worksforme

@qgib
Copy link
Contributor Author

qgib commented Oct 15, 2014

Author Name: Teliph Andersson (Teliph Andersson)


Saving a shapefile as spatialite fails for me using:
QGIS version 2.4.0-Chugiak QGIS code revision exported
Compiled against Qt 4.8.6 Running against Qt 4.8.6
Compiled against GDAL/OGR 1.10.1 Running against GDAL/OGR 1.10.1
Compiled against GEOS 3.4.2-CAPI-1.8.2 Running against GEOS 3.4.2-CAPI-1.8.2 r3921
PostgreSQL Client Version 9.4beta2 SpatiaLite Version 4.1.1
QWT Version 6.0.0-svn PROJ.4 Version 480
QScintilla2 Version

Error: Feature creation error (OGR error: sqlite3_step() failed: spatialtest.GEOMETRY violates Geometry constraint [geom-type or SRID not allowed] (19))

Shapefile used: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip

Steps to reproduce:

  • Add vector layer
  • Save as... Spatialite

  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Oct 15, 2014

Author Name: Johannes Kroeger (Johannes Kroeger)


Reproduced here with:

QGIS version 2.4.0-Chugiak
QGIS code revision fe0a303
Compiled against Qt 4.8.6
Running against Qt 4.8.6
Compiled against GDAL/OGR 1.11.0
Running against GDAL/OGR 1.11.1
Compiled against GEOS 3.4.2-CAPI-1.8.2
Running against GEOS 3.4.2-CAPI-1.8.2 r3921
PostgreSQL Client Version 9.3.5
SpatiaLite Version 4.2.0
QWT Version 6.1.0
PROJ.4 Version 480
QScintilla2 Version 2.8.

@qgib
Copy link
Contributor Author

qgib commented Oct 15, 2014

Author Name: Giovanni Manghi (@gioman)


  • subject was changed from Saving SpatiaLite fails to Saving SpatiaLite fails with "save as" dialog when input is a multi geometry
  • version was changed from 2.2.0 to master
  • resolution was changed from worksforme to
  • os_version was changed from 8.1 to
  • operating_system was changed from Windows to
  • category_id was changed from Documentation and Help to Vectors

@qgib
Copy link
Contributor Author

qgib commented Oct 15, 2014

Author Name: Giovanni Manghi (@gioman)


I added a new description to better describe the issue.

@qgib
Copy link
Contributor Author

qgib commented Oct 15, 2014

Author Name: Giovanni Manghi (@gioman)


It is more clear now where the problem may come from:

until qgis 1.7.4 saving as "sqlite" (not spatialite, because the option was not available) and adding the custom option

SPATIALITE=YES

worked as expected. Then this option stopped to work (giving an error similar to the one decribed here or creating a non functional SL db).

This should be tagged as a regression, but given the fact that there are alternatives it will be probably downgraded.


  • subject was changed from Saving SpatiaLite fails with "save as" dialog when input is a multi geometry to Saving as SpatiaLite fails with "save as" dialog when input is a multi geometry
  • priority_id was changed from Normal to Severe/Regression

@qgib
Copy link
Contributor Author

qgib commented Oct 21, 2014

Author Name: Jürgen Fischer (@jef-n)


Fixed in changeset "528c4cacb6beec73252477ea5e921d13741e37d8".


  • status_id was changed from Reopened to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats) labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
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! Vectors Related to general vector layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant