<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Josef<div>and thank you for your reply. I am actually using Qspatialite plugin to manage my spatialite layers. I checked the metadata of my database and my geometry column is of type MULTISTRING.</div><div>I use Qspatialite to transform shapefiles in spatialite and the other way, but I'm not sure how to use it to copy only some feature from a shapefile to a spatialite table. I think I have to upload it to the spatialite archive and then use sql to copy data from one table to another.</div><div><br></div><div>I'm afraid this is not so user-friendly, and my colleagues can hardly handle data in this way. Maybe actually it's better to continue using shapefiles as feature containers and wait until spatialite becomes a little bit more handily.<br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline"><br></div><div>-----</div><div>Julian Bogdani</div><div><a href="mailto:jbogdani@gmail.com">jbogdani@gmail.com</a></div><div><a href="http://bradypus.net">http://bradypus.net</a></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"></span>
</div>

<br><div><div>On 17 Sep 2012, at 2:01 , Josef K wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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>
</blockquote></div><br></div></body></html>