[GRASS-user] v.edit break ERROR: Attempt to delete dead feature
Moritz Lennert
mlennert at club.worldonline.be
Tue Aug 18 10:19:53 EDT 2009
On 18/08/09 15:34, achim wrote:
> Hi all,
>
> so I wrote a little script as workaround I want to share
Thanks for sharing this. One remark:
**************
## update network table with start,end point cats
## takes a long time!!!
v.net -c --overwrite input=$1 operation=report > line_end_cats.txt
while read line; do
cat=$(echo $line | cut -d' ' -f1)
start=$(echo $line | cut -d' ' -f2)
end=$(echo $line | cut -d' ' -f3)
## update network table, line layer
sqlite3 /home/achim/grass/sqlite_db "UPDATE $1
SET start=$start,end=$end WHERE cat = $cat;"
done < line_end_cats.txt
++++++++++++++++++++
Can't you do this with v.to.db option=start / end ? Don't know if this
is faster, though...
In any case, you can probably speed it up by putting all your SQL
statements into a file and then executing sqlite on that file outside
the loop. Database connections always create quite a lot of overhead.
Moritz
More information about the grass-user
mailing list