Re: [GRASS-user] v.edit break ERROR: Attempt to delete dead feature

2009-08-18 Thread achim
Hi all,

so I wrote a little script as workaround I want to share

while renew_cats just looks like:
v.category input=$1 output=$1_nocat option=del type=$3 layer=$2 --o
v.category input=$1_nocat output=$1 type=$3 layer=$2 --o

Its really slow, but does its job,

Greetings,
Achim

achim schrieb:
 both reported issues are serious bugs of v.edit. Can you fill trac
 ticket for that? Just to avoid that it will forgotten. I will try to
 take a look ASAP.
 
 I'll write a report then.
 
 Do you (or anyone else) have an idea how else to get the lines splitted
 on these points?
 
 Achim
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user


break_rivernetwork_correct.sh
Description: application/shellscript
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.edit break ERROR: Attempt to delete dead feature

2009-08-18 Thread Moritz Lennert

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
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.edit break ERROR: Attempt to delete dead feature

2009-08-18 Thread achim
 **
 ## 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
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.edit break ERROR: Attempt to delete dead feature

2009-08-14 Thread achim
Hello,

there is another strange result I don't understand. I attach a picture
to show, what I mean.

I guess it has to do with producing new start- and end-points and so a
new line is born?

Anyone an idea how to avoid this?

 I try to break a couple of lines on specified points (nodes in a network
 to get separated lines).
 
 I do this with for one example-point successfully:
 v.edit map=laflo_br...@achim layer=1 type=line tool=break ids=0-999
  thresh=-1,0.01,0.01 coords=32.69583,8.670833
 
 but doing this with a list of more than 6 coors or having the same coor
 twice in the list,  I get the Attempt to delete dead feature-error.
 
 Is there a limiting number of coords for v.edit or is it something else?
 What does grass try when it Attempt to delete dead feature

I now doing this one by one. ...not elegant but it works. Just have to
wait...

Achim
inline: break.jpg___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.edit break ERROR: Attempt to delete dead feature

2009-08-14 Thread Martin Landa
Hi,

2009/8/14 achim a...@jupiter.uni-freiburg.de:
 there is another strange result I don't understand. I attach a picture
 to show, what I mean.

 I guess it has to do with producing new start- and end-points and so a
 new line is born?

 Anyone an idea how to avoid this?

 I try to break a couple of lines on specified points (nodes in a network
 to get separated lines).

 I do this with for one example-point successfully:
 v.edit map=laflo_br...@achim layer=1 type=line tool=break ids=0-999
  thresh=-1,0.01,0.01 coords=32.69583,8.670833

 but doing this with a list of more than 6 coors or having the same coor
 twice in the list,  I get the Attempt to delete dead feature-error.

 Is there a limiting number of coords for v.edit or is it something else?
 What does grass try when it Attempt to delete dead feature

 I now doing this one by one. ...not elegant but it works. Just have to
 wait...

both reported issues are serious bugs of v.edit. Can you fill trac
ticket for that? Just to avoid that it will forgotten. I will try to
take a look ASAP.

Martin

-- 
Martin Landa landa.martin gmail.com * http://gama.fsv.cvut.cz/~landa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.edit break ERROR: Attempt to delete dead feature

2009-08-14 Thread achim

 both reported issues are serious bugs of v.edit. Can you fill trac
 ticket for that? Just to avoid that it will forgotten. I will try to
 take a look ASAP.

I'll write a report then.

Do you (or anyone else) have an idea how else to get the lines splitted
on these points?

Achim

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user