[GRASS-dev] [GRASS GIS] #372: v.net.iso, v.net.path

#372: v.net.iso, v.net.path
-------------------------+--------------------------------------------------
Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Keywords: | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/372&gt;
GRASS GIS <http://grass.osgeo.org>

#372: v.net.iso, v.net.path: error when using it with cost point (ncolumn)
----------------------+-----------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: Unspecified
----------------------+-----------------------------------------------------
Changes (by neteler):

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/372#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#372: v.net.iso, v.net.path: error when using it with cost point (ncolumn)
-------------------------+--------------------------------------------------
Reporter: paoloC | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: Default | Version: svn-develbranch6
Keywords: | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * milestone: 6.4.0 => 6.4.3

Comment:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/372#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#372: v.net.iso, v.net.path: error when using it with cost point (ncolumn)
----------------------------------+-----------------------------------------
Reporter: paoloC | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: Default | Version: svn-develbranch6
Keywords: v.net.iso nodes cost | Platform: Linux
      Cpu: Unspecified |
----------------------------------+-----------------------------------------
Changes (by mlennert):

  * keywords: => v.net.iso nodes cost

Comment:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/372#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#372: v.net.iso, v.net.path: error when using it with cost point (ncolumn)
----------------------------------+-----------------------------------------
Reporter: paoloC | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.3
Component: Default | Version: svn-develbranch6
Keywords: v.net.iso nodes cost | Platform: Linux
      Cpu: Unspecified |
----------------------------------+-----------------------------------------

Comment(by mmetz):

Replying to [comment:3 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/372#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#372: v.net.iso, v.net.path: error when using it with cost point (ncolumn)
----------------------+-----------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.3
Component: Default | Version: svn-develbranch6
Resolution: fixed | Keywords: v.net.iso nodes cost
  Platform: Linux | Cpu: Unspecified
----------------------+-----------------------------------------------------
Changes (by mlennert):

  * status: new => closed
  * resolution: => fixed

Comment:

Replying to [comment:4 mmetz]:
> Replying to [comment:3 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/372#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>