Ticket #1045 (closed defect: fixed)

Opened 3 years ago

Last modified 9 months ago

strange behaviour in v.net.path

Reported by: manuele Owned by: grass-dev@…
Priority: normal Milestone: 6.4.1
Component: Vector Version: unspecified
Keywords: network analysis, v.net.path Cc:
Platform: Linux CPU: x86-32

Description

Dear developers, I found that giving a complete list of origins and destinations in a file I obtain a different result respect giving a single couple from the standard output. For example with the command:

echo "26 4 9" | v.net.path am_net afcol=arc_cost out=myPathMap

I obtain this result:

"cat","id","fcat","tcat","sp","cost","fdist","tdist"
"1", "26","4", "9", "0", "3.0", "0.0", "0.0"

otherwise using the same network map with the different command:

cat am_od_pair.txt | v.net.path am_net afcol=arc_cost out=myPathMap

for the same origin destination couple I obtain:
"cat","id","fcat","tcat","sp","cost", "fdist","tdist"
"26", "26","4", "9", "1", "1.79769313486232e+19","0", "0"

where it even seams that the node 9 is not reachable.

Attachments

am_net.tar.bz2 Download (2.2 KB) - added by manuele 3 years ago.
maps needed to reproduce the bug
am_od_pairs.txt Download (243 bytes) - added by manuele 3 years ago.
origin-destination list

Change History

Changed 3 years ago by manuele

maps needed to reproduce the bug

Changed 3 years ago by manuele

origin-destination list

  Changed 3 years ago by mlennert

I can't reproduce this with the North Carolina demo data set:

v.net streets_wake points=firestations operation=connect thresh=200 out=streets_firestations
echo "1 15 64" | v.net.path streets_firestations afcol=FT_COST out=myPath
echo "1 15 64" > mypaths.txt
cat mypaths.txt | v.net.path streets_firestations afcol=FT_COST out=myPath2

v.db.select myPath
cat|id|fcat|tcat|sp|cost|fdist|tdist
1|1|15|64|0|21.379|0|0

v.db.select myPath2
cat|id|fcat|tcat|sp|cost|fdist|tdist
1|1|15|64|0|21.379|0|0

Your data is not usable as you don't define the projection system it is in, nor is the attribute table containing the arc_cost column attached. Best would be to either reproduce the bug with the demo dataset, or provide your example data as a complete location, including the sqlite database, or with a dbf attribute backend.

Moritz

follow-up: ↓ 4   Changed 3 years ago by huhabla

I can reproduce this behavior, here is a simple patch:

grass64_release/vector/v.net.path> svn diff
Index: path.c
===================================================================
--- path.c      (Revision 43825)
+++ path.c      (Arbeitskopie)
@@ -258,6 +258,7 @@

            if (ret == 0) {
                sp = SP_UNREACHABLE;
+               cost = 0;
                unreachable++;
                G_warning(_("Point %f,%f is not reachable from "
                            "point %f,%f"), tx, ty, fx, fy);


  Changed 3 years ago by hamish

  • keywords analysis, v.net.path added; analysis removed
  • milestone changed from 6.4.0 to 6.4.1

in reply to: ↑ 2 ; follow-up: ↓ 5   Changed 3 years ago by mmetz

Replying to huhabla:

I can reproduce this behavior, here is a simple patch:

I can reproduce it too with 6.4, it's fixed in 6.5 and 7 along with BUG1 and BUG2.

The patch below only sets costs to zero, node 9 is only reachable in 6.5 and 7.

> grass64_release/vector/v.net.path> svn diff
> Index: path.c
> ===================================================================
> --- path.c      (Revision 43825)
> +++ path.c      (Arbeitskopie)
> @@ -258,6 +258,7 @@
> 
>             if (ret == 0) {
>                 sp = SP_UNREACHABLE;
> +               cost = 0;
>                 unreachable++;
>                 G_warning(_("Point %f,%f is not reachable from "
>                             "point %f,%f"), tx, ty, fx, fy);
> 
> 

in reply to: ↑ 4   Changed 9 months ago by mmetz

  • status changed from new to closed
  • resolution set to fixed

Replying to mmetz:

Replying to huhabla:

I can reproduce this behavior, here is a simple patch:

I can reproduce it too with 6.4, it's fixed in 6.5 and 7 along with BUG1 and BUG2.

Fixed 2 years ago in r44066. Closing ticket.

Note: See TracTickets for help on using tickets.