Hi Julian<br><br>I guess your problem is related to geometry types (<a href="http://www.gaia-gis.it/spatialite-2.4.0-4/spatialite-cookbook/html/new-geom.html">http://www.gaia-gis.it/spatialite-2.4.0-4/spatialite-cookbook/html/new-geom.html</a>). Try to define your spatialite geometries as multipoint, multilinestring and multipolygons. Then they will be more compatible with shapefiles and you may copy/paste in qgis. <br>
<br>Although I would recommend that you tried using spatialite-gui (or perahaps qspatialite) instead. By those tools you can temporarily upload the shapefile to your database file and then use sql syntax 'insert into ... select ... ' the features you want into your db tables. Using sql syntax will give you more control of fields, data types etc. <br>
<br>regards<br>Josef<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Date: Sun, 16 Sep 2012 11:53:30 +0200<br>
From: Julian Bogdani <<a href="mailto:jbogdani@gmail.com">jbogdani@gmail.com</a>><br>
To: qgis-user <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>><br>
Subject: [Qgis-user] Copy / paste features to spatialite generates<br>
        error<br>
Message-ID: <<a href="mailto:A7512D49-0F85-4CB5-A3D2-85DA4919E24C@gmail.com">A7512D49-0F85-4CB5-A3D2-85DA4919E24C@gmail.com</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
Hello all,<br>
I've tried to add to an existing spatialite layer some features from another layer.<br>
The existing layer is a simple shapefile: I selected the features I wanted to copy and pasted to the spatialite layer. Everything was working file until I tried to save the changes. The following error appears:<br>
<br>
Could not commit changes to layer Plan_gen<br>
<br>
Errors: ERROR: 903 feature(s) not added.<br>
Provider errors:<br>
SQLite error: Plan_gen.Geometry violates Geometry constraint [geom-type or SRID not allowed]<br>
SQL: INSERT INTO "Plan_gen"("PKUID","Geometry","Layer","area") VALUES (NULL,GeomFromWKB(?, 32634),?,?)<br>
<br>
<br>
it states it might be a problem of geometry type or a SRID problem. All layers are in the same CRS (EPSG:32634), and all features, in both layers, are of type polyline.<br>
<br>
Is it a spatialite bug? a qgis bug? or Am I missing anything?<br>
<br>
I've had this issue with other data before. The solution I adopted to work around this was:<br>
1) save the spatialite layer as shapefile<br>
2) paste data into the newly created shapefile<br>
3) delete the spatialite table<br>
4) load in the spatialite DB the shapefile<br>
<br>
This works, but it is too tricky for everyday use. I tried to convert all my shapefiles to spatialite, but the limitation spatilite still have in data structure manipulation (adding/removing/renaming fields, etc, a sqlite limit in fact) and now in content editing make me think that that was not a good idea. I can not switch this archives to postGIS yet, because of the actual work-flow organization of the project.<br>

<br>
Any help or advice will be appreciated!<br>
<br>
<br>
-----<br>
Julian Bogdani<br>
<a href="mailto:jbogdani@gmail.com">jbogdani@gmail.com</a><br>
<a href="http://bradypus.net" target="_blank">http://bradypus.net</a><br></blockquote></div>