[GRASS-dev] [GRASS GIS] #1861: v.net.distance should exclude path to self

#1861: v.net.distance should exclude path to self
------------------------------+---------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: network distance | Platform: Unspecified
      Cpu: Unspecified |
------------------------------+---------------------------------------------
When using v.net.distance in grass7, giving it all the available nodes as
from and to nodes, the result is a series of zero length paths from each
node to itself. v.net.distance should skip paths to self and chose the
closest node amongst the remaining set of nodes.

To reproduce:

{{{
v.net roadsmajor points=schools_wake op=connect thresh=500 out=network --o
}}}

["thresh" should probably be renamed to "threshold" for consistency]

{{{
v.net.distance network out=paths from_layer=2 from_cats=1-999 to_layer=2
to_cats=1-999 --o
}}}

[from_layer and to_layer should probably be 2 by default]

{{{
v.db.select paths

cat|tcat|dist
7|7|0
8|8|0
9|9|0
28|28|0
[...]
}}}

Moritz

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

#1861: v.net.distance should exclude path to self
------------------------------+---------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: network distance | Platform: Unspecified
      Cpu: Unspecified |
------------------------------+---------------------------------------------

Comment(by mmetz):

Replying to [ticket:1861 mlennert]:
> When using v.net.distance in grass7, giving it all the available nodes
as from and to nodes, the result is a series of zero length paths from
each node to itself. v.net.distance should skip paths to self and chose
the closest node amongst the remaining set of nodes.

Technically, this is possible and actually not very difficult, but it
would require to rewrite v.net.distance from scratch.

Currently, the module starts with all 'to' nodes and calculates the
shortest path of all nodes to all 'to' nodes. Then the module iterates
through the 'from' nodes and finds for each 'from' node the nearest 'to'
node. At this point it is too late to exclude paths to self because that
is the only path computed.

Markus M

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

#1861: v.net.distance should exclude path to self
------------------------------+---------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: network distance | Platform: Unspecified
      Cpu: Unspecified |
------------------------------+---------------------------------------------

Comment(by mlennert):

Replying to [comment:1 mmetz]:
> Replying to [ticket:1861 mlennert]:
> > When using v.net.distance in grass7, giving it all the available nodes
as from and to nodes, the result is a series of zero length paths from
each node to itself. v.net.distance should skip paths to self and chose
the closest node amongst the remaining set of nodes.
>
> Technically, this is possible and actually not very difficult, but it
would require to rewrite v.net.distance from scratch.
>
> Currently, the module starts with all 'to' nodes and calculates the
shortest path of all nodes to all 'to' nodes. Then the module iterates
through the 'from' nodes and finds for each 'from' node the nearest 'to'
node. At this point it is too late to exclude paths to self because that
is the only path computed.

Ok, then I'll just add a hint to the man page indicating that from and to
nodes should be different. One can always use v.net.allpairs to get the
same info with a bit of postprocess data massaging.

Moritz

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

#1861: v.net.distance should exclude path to self
--------------------------+-------------------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: wontfix | Keywords: network distance
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by mlennert):

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

Comment:

Replying to [comment:2 mlennert]:
> Replying to [comment:1 mmetz]:
> > Replying to [ticket:1861 mlennert]:
> > > When using v.net.distance in grass7, giving it all the available
nodes as from and to nodes, the result is a series of zero length paths
from each node to itself. v.net.distance should skip paths to self and
chose the closest node amongst the remaining set of nodes.
> >
> > Technically, this is possible and actually not very difficult, but it
would require to rewrite v.net.distance from scratch.
> >
> > Currently, the module starts with all 'to' nodes and calculates the
shortest path of all nodes to all 'to' nodes. Then the module iterates
through the 'from' nodes and finds for each 'from' node the nearest 'to'
node. At this point it is too late to exclude paths to self because that
is the only path computed.
>
> Ok, then I'll just add a hint to the man page indicating that from and
to nodes should be different.

Done in all branches.

Moritz

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