[GRASS-user] v.net.iso - node costs

Hi all

how can I use v.net.iso with node costs ?

I tried this:

g.copy vect=roads,myroads,archsites,myarchsites --o

v.net myroads points=myarchsites out=mynetwork op=connect thresh=1000 --o

v.db.addtable mynetwork layer=2 col="cat integer, cost double precision"

echo "update mynetwork_2 set cost=1" | db.execute

v.net.iso in=mynetwork out=isocost alayer=1 nlayer=2 ncolumn=cost
ccats=1-10 cost=200,600,800,1200,5000 --o

and I get this error:

ERROR: Vect_read_line(): feature id -384 is not reasonable (max features in

       vector map <mynetwork@user1>: 900)

No error I found if I omit ncolumn option (calculus without node costs).

Thank you,

Paolo

On 11/11/08 15:31, Paolo Craveri wrote:

Hi all

how can I use v.net.iso with node costs ?

I tried this:

g.copy vect=roads,myroads,archsites,myarchsites --o

v.net myroads points=myarchsites out=mynetwork op=connect thresh=1000 --o

v.db.addtable mynetwork layer=2 col="cat integer, cost double precision"

echo "update mynetwork_2 set cost=1" | db.execute

Is mynetwork_2 attached to any map ?

What does 'v.category map=mynetwork option=report' give you ?

What does 'v.db.select map=mynetwork layer=2' give you ?

Moritz

Hi Moritz

Is mynetwork_2 attached to any map ?

Yes.
v.db.connect mynetwork -p
Vector map <mynetwork@user1> is connected by:
layer <1> table <mynetwork> in database
</home/craveripaololivio/grassdata/spearfish60/user1/sqlite.db>
through driver <sqlite> with key <cat>
layer <2> table <mynetwork_2> in database
</home/craveripaololivio/grassdata/spearfish60/user1/sqlite.db>
through driver <sqlite> with key <cat>

What does 'v.category map=mynetwork option=report' give you ?

GRASS 6.4.svn (spearfish60):~ > v.category mynetwork option=report
Layer/table: 1/mynetwork
type count min max
point 0 0 0
line 875 1 5
boundary 0 0 0
centroid 0 0 0
area 0 0 0
all 875 1 5
Layer/table: 2/mynetwork_2
type count min max
point 25 1 25
line 0 0 0
boundary 0 0 0
centroid 0 0 0
area 0 0 0
all 25 1 25

What does 'v.db.select map=mynetwork layer=2' give you ?

GRASS 6.4.svn (spearfish60):~ > v.db.select map=mynetwork layer=2
cat|cost
1|1
2|1
3|1
4|1
5|1
6|1
7|1
8|1
9|1
10|1
11|1
12|1
13|1
14|1
15|1
16|1
17|1
18|1
19|1
20|1
21|1
22|1
23|1
24|1
25|1

I also tried others modules (e.g. v.net.path) getting the same error
if I use point cost (eg : ncolumn=cost)

Many thanks.

Paolo

Hi all

I wonder if v.net.iso gives this error only to me, using cost point (ncolumn).

Can anyone tell me what is wrong in this code?

#!/bin/sh
##spearfish60 dataset
db.connect driver=sqlite database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db'
g.copy vect=roads,myroads,archsites,myarchsites --o
v.distance -p from=myarchsites to=myroads upload=dist col=dist
v.net myroads points=myarchsites out=mynetwork op=connect thresh=1000 --o
v.db.addtable mynetwork layer=2 col="cat integer, cost integer"
### simply add a foo point cost
echo "update mynetwork_2 set cost=1" | db.execute

### this line gives an error:
### ERROR: Vect_read_line(): line '-384' is not reasonable (max line in map:
### 900)
v.net.iso in=mynetwork out=isocost alayer=1 nlayer=2 ncolumn=cost
ccats=1-10 cost=200,600,800,1200,5000 --o

Many thanks in advance.

Paolo

Paolo Craveri wrote:

I wonder if v.net.iso gives this error only to me, using
cost point (ncolumn).

Can anyone tell me what is wrong in this code?

yes, I get the same error.

v.distance -p from=myarchsites to=myroads upload=dist col=dist

note this command just prints to the screen, it doesn't upload the value
to the map.

### this line gives an error:
### ERROR: Vect_read_line(): line '-384' is not reasonable (max line in map:
### 900)
v.net.iso in=mynetwork out=isocost alayer=1 nlayer=2 ncolumn=cost \
  ccats=1-10 cost=200,600,800,1200,5000

with `g.gisenv set="DEBUG=5"` it shows that the error arrives in
lib/vector/Vlib/net.c line ~ 374 and lib/vector/Vlib/level_two.c line
~ 261, but then I find it hard to follow the memory address for
Map->plus.Node.

....
D1/5: node costs: nrec = 25
D2/5: node = 1 nlines = 1
D2/5: line (0) = 1
D3/5: Vect_read_line()
D3/5: V2_read_line_nat(): line = 1
D3/5: Vect__Read_line_nat: offset = 14
D3/5: type = 2, do_cats = 1 dead = 0
D3/5: n_cats = 1
D3/5: n_points = 19
D3/5: off = 335
D2/5: Category of field 2 not attached to any points in node 1(costs set to 0)
D3/5: Set node's cost to 0
D2/5: node = 2 nlines = 3
D2/5: line (0) = -384
D3/5: Vect_read_line()
....

same result with: v.net.iso ... nlayer=1 ncolumn=cat

Hamish

Hi Hamish, all

2008/11/18 Hamish <hamish_b@yahoo.com>:

yes, I get the same error.

A trouble shared is a trouble halved.

with `g.gisenv set="DEBUG=5"` it shows that the error arrives in
lib/vector/Vlib/net.c line ~ 374 and lib/vector/Vlib/level_two.c line
~ 261, but then I find it hard to follow the memory address for
Map->plus.Node.

....

Not very much about this in the bug tracker. Is this a bug/defect ?

Paolo