Does the bug fixed?

23 messages Options
Embed this post
Permalink
1 2
Moritz Lennert

Re: v.edit break ERROR: Attempt to delete dead feature

Reply Threaded More More options
Print post
Permalink
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
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
achim

Re: v.edit break ERROR: Attempt to delete dead feature

Reply Threaded More More options
Print post
Permalink
> **************
> ## 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...
it would be faster, but v.to.db option=start/end just update the
coordinate (x,y).
then two double values instead of one integer will have to be compared

>
> 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.
right, good idea. Another possibility would be to make a table from
"v.net -c --overwrite input=$1 operation=report" and make the update
with one sql statement. ...but its just a workaround and not a final
version ;-).

Achim


_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
achim

Re: v.edit break ERROR: Attempt to delete dead feature

Reply Threaded More More options
Print post
Permalink
in line 43 I updated a thresh:
v.edit --quiet map=$1 layer=1 type=line tool=break cats=$catlist
coords=$coord thresh=-1,0,0

-1,0,0 is default, but its to emphasize, that this is important!
Because it uses the current resolution as thresh, there will be done
something wrong with near points:
so resolution must be set up (grid size a third or whatever)

Achim


achim schrieb:

>> **************
>> ## 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...
> it would be faster, but v.to.db option=start/end just update the
> coordinate (x,y).
> then two double values instead of one integer will have to be compared
>
>> 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.
> right, good idea. Another possibility would be to make a table from
> "v.net -c --overwrite input=$1 operation=report" and make the update
> with one sql statement. ...but its just a workaround and not a final
> version ;-).
>
> Achim
>
>
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user


_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user

break_rivernetwork_correct.sh (2K) Download Attachment
1 2