[GRASS-user] sqlite error using v.patch -a -e in GRASS 7.0

Marti Christian cmarti at student.ethz.ch
Wed Jun 13 04:38:39 PDT 2012


Hi,

I encountered a problem using v.patch -a -e. I am using v.patch in a loop (python script) to append vector maps with parts of a street network to a map (so that map would contain the entire network in the end).

While running the script, for a while the code works fine, i.e. some maps get appended and no error occurs. However, after some successful loop iterations, an sqlite error occurs. It looks like this (in GRASS GUI console):

city: 31
zone: 552
DBMI-SQLite driver error:
Error in sqlite3_step():
column cat is not unique
ERROR: Cannot insert new record: 'insert into GM_street_network_all values ( 10615, 279120, '')'

"zone" is an ID for the map to append (output with grass.info). I tried to run the script a second time, and the same thing happened, BUT NOT IN THE SAME ITERATION:

city: 23
zone: 618
DBMI-SQLite driver error:
Error in sqlite3_step():
column cat is not unique
ERROR: Cannot insert new record: 'insert into GM_street_network_all values ( 7962, 316594, '')'

All the maps I append have cat columns starting with a value of 1. As far as I understand, v.patch -e -a adds all the elements in the table of the map to be appended to the table of the patched map with new values for 'cat', so I do not understand how this possibly could not be unique.

The fact that the error does not occur systematically (i.e. in the same iteration, with the same map to be appended) makes me assume the problem lies not in the maps and tables, but I do not have much knowledge about databases.

Any ideas what could be the source of this error? I would be grateful for any hints!

OS: Windows 7
GRASS Version: WinGRASS-7.0.svn-r51992-255

Best regards
Christian



More information about the grass-user mailing list