Opened 11 years ago

Closed 7 years ago

#372 closed defect (fixed)

v.net.iso, v.net.path: error when using it with cost point (ncolumn)

Reported by: paoloC Owned by: grass-dev@…
Priority: major Milestone: 6.4.3
Component: Default Version: svn-develbranch6
Keywords: v.net.iso nodes cost Cc:
CPU: Unspecified Platform: Linux

Description

v.net.iso turn back an error when using it with cost point (ncolumn).

The same with v.net.path,v.net.alloc etc.

see this thread:

http://www.nabble.com/v.net.iso---node-costs-td20440903.html

Change History (5)

comment:1 Changed 11 years ago by neteler

Summary: v.net.iso, v.net.pathv.net.iso, v.net.path: error when using it with cost point (ncolumn)

comment:2 Changed 7 years ago by neteler

Milestone: 6.4.06.4.3

The v.net.* modules have been improved in 6.4.svn, still an issue?

comment:3 Changed 7 years ago by mlennert

Keywords: v.net.iso nodes cost added

The bug is still in issue in all versions. See [1] for the original postings on the mailing list (the nabble link provided by the OP is dead).

Here's how to reproduce in trunk with the NC data:

v.net roadsmajor poi=schools_wake thresh=500 op=connect out=network
v.db.addtable network layer=2 col="cat integer, cost integer"
echo "update network_2 set cost=1" | db.execute in=-
v.net.iso in=network out=isocost alayer=1 nlayer=2 ncolumn=cost ccats=1-10 cost=5000,10000,20000

The error is

Setting node costs...
ERREUR :Requested feature id 0 is not reasonable(max features in vector map
        <network@user1>: 457)

The error does not appear when v.net.iso is run without the ncolumn option.

The issue is in lib/vector/Vlib/net.c the for-loop starting line 377, based on the number of nodes (nnodes) retrieved from the map in line 133 with Vect_get_num_nodes(Map). This gives a number of nodes which at one point leads to the error. Using DEBUG=2, I can see that the problem arises with node 265. Replacing the nnodes variable in the loop definition with 264, the module runs.

I still have to figure out what exactly this number of nodes represents (well, I know it is the number of nodes you also get as output of v.build network) and what it is used for here, but it certainly is not related to the nodes (i.e. the schools) I added with the v.net command.

MarkusN, do you have a quick idea on this ? Otherwise, I'll continue looking.

Moritz

[1] http://lists.osgeo.org/pipermail/grass-user/2008-November/047624.html

comment:4 in reply to:  3 ; Changed 7 years ago by mmetz

Replying to mlennert:

The bug is still in issue in all versions.

This should be fixed in all versions with r53738-40, but similar bugs may still exist in some modules.

I still have to figure out what exactly this number of nodes represents (well, I know it is the number of nodes you also get as output of v.build network) and what it is used for here, but it certainly is not related to the nodes (i.e. the schools) I added with the v.net command.

These nodes are topological nodes as reported by v.build and not necessarily network nodes as added with v.net. What Vect_net_build_graph() does is going through all topological nodes and then looking if a network node (GV_POINT) exists at that topological node.

MarkusN, do you have a quick idea on this ? Otherwise, I'll continue looking.

Sorry for interfering;)

Markus M

comment:5 in reply to:  4 Changed 7 years ago by mlennert

Resolution: fixed
Status: newclosed

Replying to mmetz:

Replying to mlennert:

The bug is still in issue in all versions.

This should be fixed in all versions with r53738-40, but similar bugs may still exist in some modules.

I can confirm the fix. Thanks ! I'll close this bug. If other modules show issues, we can file new ones for those.

I still have to figure out what exactly this number of nodes represents (well, I know it is the number of nodes you also get as output of v.build network) and what it is used for here, but it certainly is not related to the nodes (i.e. the schools) I added with the v.net command.

These nodes are topological nodes as reported by v.build and not necessarily network nodes as added with v.net. What Vect_net_build_graph() does is going through all topological nodes and then looking if a network node (GV_POINT) exists at that topological node.

Thanks for the clear explanation.

MarkusN, do you have a quick idea on this ? Otherwise, I'll continue looking.

Sorry for interfering;)

Sorry, guys ! Seems like I'm temporarily (hopefully) dyslexic concerning N's and M's...

Moritz

Note: See TracTickets for help on using tickets.