[GRASS-user] Multiple v.net.path parameters

Hello,

I am looking to use v.net.path to determine the distance of many different points to many different other points on a network.

Is it possible to send multiple parameters to v.net.path? For instance, I have (in theory) 4 points connected to a network. I want to find the distance of the line segments between points 1 and 4, 2 and 4, & 3 and 4.

I want to:
run v.net.path once by passing multiple parameters;
get vector line output of each of these three paths found by v.net.path in one output file;
calculate the distance of each line from the file using v.to.db.

Since this is not a module of GRASS which I have worked with in the past, I am wondering if this is possible.

Thanks
John

On 01/07/09 04:44, J. Holden wrote:

Hello,

I am looking to use v.net.path to determine the distance of many
different points to many different other points on a network.

Is it possible to send multiple parameters to v.net.path? For
instance, I have (in theory) 4 points connected to a network. I want
to find the distance of the line segments between points 1 and 4, 2
and 4, & 3 and 4.

I want to: run v.net.path once by passing multiple parameters; get
vector line output of each of these three paths found by v.net.path
in one output file; calculate the distance of each line from the file
using v.to.db.

Since this is not a module of GRASS which I have worked with in the
past, I am wondering if this is possible.

Sure, as mentioned on the man page:

"Nodes can be piped into the program from file or from stdin. The syntax is as follows:

id start_point_category end_point_category

or

id start_point_x start_point_y end_point_x end_point_y"

So to take your example, and assuming that 1,2,3,4 are category values of existing points:

Create a file containing:

1 1 4
2 2 4
3 3 4

and feed it to v.net.path with the file= parameter.

You will then get one vector map with severals lines which have the category values used in the first column of your file.

Moritz

Hello all,

I have finished v.net.distance module as a part of my Google Summer of
Code project. The (source code of) module can be downloaded from grass
add-ons repository (vector/net.analyze). I recommend to download the
entire directory to avoid any compilation issues. Additionally, you
get an access to some latest network analysis modules! Anyway, simple
make command in the net.analyze directory should compile the modules
(and library). There is no documentation (yet), however, the interface
should be similar to the one used in v.net.path and/or v.distance.
Finally, here is a couple of nice pictures:

http://people.ksp.sk/~dano/grass/nd.png
http://people.ksp.sk/~dano/grass/ndt.png
http://people.ksp.sk/~dano/grass/ndtd.png

Blue and orange lines show the shortest length and time paths respectively.

Best,
Daniel

On Wed, Jul 1, 2009 at 5:56 PM, Moritz
Lennert<mlennert@club.worldonline.be> wrote:

On 01/07/09 04:44, J. Holden wrote:

Hello,

I am looking to use v.net.path to determine the distance of many
different points to many different other points on a network.

Is it possible to send multiple parameters to v.net.path? For
instance, I have (in theory) 4 points connected to a network. I want
to find the distance of the line segments between points 1 and 4, 2
and 4, & 3 and 4.

I want to: run v.net.path once by passing multiple parameters; get
vector line output of each of these three paths found by v.net.path
in one output file; calculate the distance of each line from the file
using v.to.db.

Since this is not a module of GRASS which I have worked with in the
past, I am wondering if this is possible.

Sure, as mentioned on the man page:

"Nodes can be piped into the program from file or from stdin. The syntax is
as follows:

id start_point_category end_point_category

or

id start_point_x start_point_y end_point_x end_point_y"

So to take your example, and assuming that 1,2,3,4 are category values of
existing points:

Create a file containing:

1 1 4
2 2 4
3 3 4

and feed it to v.net.path with the file= parameter.

You will then get one vector map with severals lines which have the category
values used in the first column of your file.

Moritz
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On 08/07/09 21:09, Daniel Bundala wrote:

Hello all,

I have finished v.net.distance module as a part of my Google Summer of
Code project.

Great work !! I'll test as soon as I have a bit more time.

Moritz

Hello Daniel (and others),

I ran the module successfully, but only with a network, where every line
ends with the next node.

In attached example it is possible to calc path from 1 to 4 and from 5
to 6, but not from 1 to 2,3,5,6 or from 5 to anywhere expect 6 and so on.

Do you have an idea how to handle this?

Especially: do you know if "breaking the lines" (eg. dark green one at
point 5) is possible with networking techniques?

Sorry for asking you directly, but I hopefully thought you are deep
inside the topic at the moment.

Thanks anyway for your work!
Achim

Daniel Bundala schrieb

Hello all,

I have finished v.net.distance module as a part of my Google Summer of
Code project. The (source code of) module can be downloaded from grass
add-ons repository (vector/net.analyze). I recommend to download the
entire directory to avoid any compilation issues. Additionally, you
get an access to some latest network analysis modules! Anyway, simple
make command in the net.analyze directory should compile the modules
(and library). There is no documentation (yet), however, the interface
should be similar to the one used in v.net.path and/or v.distance.
Finally, here is a couple of nice pictures:

http://people.ksp.sk/~dano/grass/nd.png
http://people.ksp.sk/~dano/grass/ndt.png
http://people.ksp.sk/~dano/grass/ndtd.png

Blue and orange lines show the shortest length and time paths respectively.

Best,
Daniel

On Wed, Jul 1, 2009 at 5:56 PM, Moritz
Lennert<mlennert@club.worldonline.be> wrote:

On 01/07/09 04:44, J. Holden wrote:

Hello,

I am looking to use v.net.path to determine the distance of many
different points to many different other points on a network.

Is it possible to send multiple parameters to v.net.path? For
instance, I have (in theory) 4 points connected to a network. I want
to find the distance of the line segments between points 1 and 4, 2
and 4, & 3 and 4.

I want to: run v.net.path once by passing multiple parameters; get
vector line output of each of these three paths found by v.net.path
in one output file; calculate the distance of each line from the file
using v.to.db.

Since this is not a module of GRASS which I have worked with in the
past, I am wondering if this is possible.

Sure, as mentioned on the man page:

"Nodes can be piped into the program from file or from stdin. The syntax is
as follows:

id start_point_category end_point_category

or

id start_point_x start_point_y end_point_x end_point_y"

So to take your example, and assuming that 1,2,3,4 are category values of
existing points:

Create a file containing:

1 1 4
2 2 4
3 3 4

and feed it to v.net.path with the file= parameter.

You will then get one vector map with severals lines which have the category
values used in the first column of your file.

Moritz
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

..with attachment

Hello Daniel (and others),

I ran the module successfully, but only with a network, where every line
ends with the next node.

In attached example it is possible to calc path from 1 to 4 and from 5
to 6, but not from 1 to 2,3,5,6 or from 5 to anywhere expect 6 and so on.

Do you have an idea how to handle this?

Especially: do you know if "breaking the lines" (eg. dark green one at
point 5) is possible with networking techniques?

Sorry for asking you directly, but I hopefully thought you are deep
inside the topic at the moment.

Thanks anyway for your work!
Achim

Daniel Bundala schrieb

> Hello all,
>
> I have finished v.net.distance module as a part of my Google Summer of
> Code project. The (source code of) module can be downloaded from grass
> add-ons repository (vector/net.analyze). I recommend to download the
> entire directory to avoid any compilation issues. Additionally, you
> get an access to some latest network analysis modules! Anyway, simple
> make command in the net.analyze directory should compile the modules
> (and library). There is no documentation (yet), however, the interface
> should be similar to the one used in v.net.path and/or v.distance.
> Finally, here is a couple of nice pictures:
>
> http://people.ksp.sk/~dano/grass/nd.png
> http://people.ksp.sk/~dano/grass/ndt.png
> http://people.ksp.sk/~dano/grass/ndtd.png
>
> Blue and orange lines show the shortest length and time paths

respectively.

>
> Best,
> Daniel
>
> On Wed, Jul 1, 2009 at 5:56 PM, Moritz
> Lennert<mlennert@club.worldonline.be> wrote:

>> On 01/07/09 04:44, J. Holden wrote:

>>> Hello,
>>>
>>> I am looking to use v.net.path to determine the distance of many
>>> different points to many different other points on a network.
>>>
>>> Is it possible to send multiple parameters to v.net.path? For
>>> instance, I have (in theory) 4 points connected to a network. I want
>>> to find the distance of the line segments between points 1 and 4, 2
>>> and 4, & 3 and 4.
>>>
>>> I want to: run v.net.path once by passing multiple parameters; get
>>> vector line output of each of these three paths found by v.net.path
>>> in one output file; calculate the distance of each line from the

file

>>> using v.to.db.
>>>
>>> Since this is not a module of GRASS which I have worked with in the
>>> past, I am wondering if this is possible.

>> Sure, as mentioned on the man page:
>>
>> "Nodes can be piped into the program from file or from stdin. The

syntax is

>> as follows:
>>
>> id start_point_category end_point_category
>>
>> or
>>
>> id start_point_x start_point_y end_point_x end_point_y"
>>
>>
>> So to take your example, and assuming that 1,2,3,4 are category

values of

>> existing points:
>>
>> Create a file containing:
>>
>> 1 1 4
>> 2 2 4
>> 3 3 4
>>
>> and feed it to v.net.path with the file= parameter.
>>
>> You will then get one vector map with severals lines which have

the category

>> values used in the first column of your file.
>>
>> Moritz
>> _______________________________________________
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>

> _______________________________________________
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

(attachments)

path.jpg

achim wrote:

In attached example it is possible to calc path from 1 to 4
and from 5 to 6, but not from 1 to 2,3,5,6 or from 5 to anywhere
expect 6 and so on.

Do you have an idea how to handle this?

Especially: do you know if "breaking the lines" (eg. dark
green one at point 5) is possible with networking techniques?

from the image the little "+"s indicate there are nodes at all
intersections, so there is nothing to break really. (unless there
are two lines on top of each other, in which case you can do v.clean
remove duplicates tool)

if you want each line to have it's own color/cat use v.category option
to remove all cat numbers then again to add new ones sequentially. you
might have to do that in another column and then change the key column
to the new one with v.reclass.

Hamish

Hamish schrieb:

> achim wrote:

>> In attached example it is possible to calc path from 1 to 4
>> and from 5 to 6, but not from 1 to 2,3,5,6 or from 5 to anywhere
>> expect 6 and so on.
>>
>> Do you have an idea how to handle this?
>>
>> Especially: do you know if "breaking the lines" (eg. dark
>> green one at point 5) is possible with networking techniques?

>
>
> from the image the little "+"s indicate there are nodes at all
> intersections, so there is nothing to break really. (unless there
> are two lines on top of each other, in which case you can do v.clean
> remove duplicates tool)
>
> if you want each line to have it's own color/cat use v.category option
> to remove all cat numbers then again to add new ones sequentially. you
> might have to do that in another column and then change the key column
> to the new one with v.reclass.
>
>
> Hamish
>

In my test-area I get for this network:

type count min max
point 0 0 0
line 466 1 466
boundary 0 0 0
centroid 0 0 0
area 0 0 0
all 466 1 466
Layer: 2
type count min max
point 642 1 642
line 0 0 0
boundary 0 0 0
centroid 0 0 0
area 0 0 0
all 642 1 642

after revoming duplicates (and re-categorization) the same
so its nothing about the and categories :slight_smile: .

after v.cleak=break (and re-categorization) I get:

type count min max
point 0 0 0
line 619 1 619
boundary 0 0 0
centroid 0 0 0
area 0 0 0
all 619 1 619
Layer: 2
type count min max
point 642 1 642
line 0 0 0
boundary 0 0 0
centroid 0 0 0
area 0 0 0
all 642 1 642

so automatically it doe's something in nearly the right way
(see http://article.gmane.org/gmane.comp.gis.grass.user/31102 for this)

The breaking tool does not work, so I try doing it with network-tools.

A

Hello Achim,

If I understand your description and image correctly, then the line
from 1 to 4 is one single line and nodes 2 and 3 lie on it. If this is
the case then the module does not find a path from, say, 1 to 5. The
reason is, as you mentioned in your email, that "the module runs
successfully, but only with a network, where every line ends with the
next node" and the module "ignores" intermediate nodes. I did not test
it, but I think you get the same behaviour with v.net.path as well. In
general, this is not a bug. The thing is that the line lengths/costs
are read from a table and may represent anything and so if you know
that the cost of traversing from 1 to 4 is X then this does not tell
you what the cost of traversing from 1 to 2 or 2-3 should be. So to
fix it, you need to break the lines that is, to break line 1-4 to
lines 1-2, 2-3, 3-4.

Hope this helps,
Daniel

On Mon, Aug 17, 2009 at 3:07 PM, achim<ak7@jupiter.uni-freiburg.de> wrote:

Hello Daniel (and others),

I ran the module successfully, but only with a network, where every line
ends with the next node.

In attached example it is possible to calc path from 1 to 4 and from 5
to 6, but not from 1 to 2,3,5,6 or from 5 to anywhere expect 6 and so on.

Do you have an idea how to handle this?

Especially: do you know if "breaking the lines" (eg. dark green one at
point 5) is possible with networking techniques?

Sorry for asking you directly, but I hopefully thought you are deep
inside the topic at the moment.

Thanks anyway for your work!
Achim

Daniel Bundala schrieb

Hello all,

I have finished v.net.distance module as a part of my Google Summer of
Code project. The (source code of) module can be downloaded from grass
add-ons repository (vector/net.analyze). I recommend to download the
entire directory to avoid any compilation issues. Additionally, you
get an access to some latest network analysis modules! Anyway, simple
make command in the net.analyze directory should compile the modules
(and library). There is no documentation (yet), however, the interface
should be similar to the one used in v.net.path and/or v.distance.
Finally, here is a couple of nice pictures:

http://people.ksp.sk/~dano/grass/nd.png
http://people.ksp.sk/~dano/grass/ndt.png
http://people.ksp.sk/~dano/grass/ndtd.png

Blue and orange lines show the shortest length and time paths respectively.

Best,
Daniel

On Wed, Jul 1, 2009 at 5:56 PM, Moritz
Lennert<mlennert@club.worldonline.be> wrote:

On 01/07/09 04:44, J. Holden wrote:

Hello,

I am looking to use v.net.path to determine the distance of many
different points to many different other points on a network.

Is it possible to send multiple parameters to v.net.path? For
instance, I have (in theory) 4 points connected to a network. I want
to find the distance of the line segments between points 1 and 4, 2
and 4, & 3 and 4.

I want to: run v.net.path once by passing multiple parameters; get
vector line output of each of these three paths found by v.net.path
in one output file; calculate the distance of each line from the file
using v.to.db.

Since this is not a module of GRASS which I have worked with in the
past, I am wondering if this is possible.

Sure, as mentioned on the man page:

"Nodes can be piped into the program from file or from stdin. The syntax is
as follows:

id start_point_category end_point_category

or

id start_point_x start_point_y end_point_x end_point_y"

So to take your example, and assuming that 1,2,3,4 are category values of
existing points:

Create a file containing:

1 1 4
2 2 4
3 3 4

and feed it to v.net.path with the file= parameter.

You will then get one vector map with severals lines which have the category
values used in the first column of your file.

Moritz
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hello Daniel,

thanks you very much for helping.

If I understand your description and image correctly, then the line
from 1 to 4 is one single line and nodes 2 and 3 lie on it. If this is

You understand me right. I thought, you maybe knew a way, doing the
breaking of the lines at the "on line laying" points.

I thought its there is a way like "automatically(!) adding a little road
to a big one from one side (not crossing) and integrating it to the
network"?

Greetings,
Achim

PS:
The bug is in the v.edit tool=break, as I mentioned before:
breaking one selected line on a desired coordinate works well, but
selecting two or more (or all) (eg. yellow and red, point 2) breaking on
the same point, I get artifacts. This depends on the direction of the
yellow line.

(like
http://lists.osgeo.org/pipermail/grass-user/attachments/20090814/816f9568/break-0001.jpg)

If you have an idea..its welcome!
Not being in touch with the structure of the program, sadly I am not
capable of fixing the bug in acceptable time,

Daniel Bundala schrieb:

the case then the module does not find a path from, say, 1 to 5. The
reason is, as you mentioned in your email, that "the module runs
successfully, but only with a network, where every line ends with the
next node" and the module "ignores" intermediate nodes. I did not test
it, but I think you get the same behaviour with v.net.path as well. In
general, this is not a bug. The thing is that the line lengths/costs
are read from a table and may represent anything and so if you know
that the cost of traversing from 1 to 4 is X then this does not tell
you what the cost of traversing from 1 to 2 or 2-3 should be. So to
fix it, you need to break the lines that is, to break line 1-4 to
lines 1-2, 2-3, 3-4.

Hope this helps,
Daniel

On Mon, Aug 17, 2009 at 3:07 PM, achim<ak7@jupiter.uni-freiburg.de> wrote:

Hello Daniel (and others),

I ran the module successfully, but only with a network, where every line
ends with the next node.

In attached example it is possible to calc path from 1 to 4 and from 5
to 6, but not from 1 to 2,3,5,6 or from 5 to anywhere expect 6 and so on.

Do you have an idea how to handle this?

Especially: do you know if "breaking the lines" (eg. dark green one at
point 5) is possible with networking techniques?

Sorry for asking you directly, but I hopefully thought you are deep
inside the topic at the moment.

Thanks anyway for your work!
Achim

Daniel Bundala schrieb

Hello all,

I have finished v.net.distance module as a part of my Google Summer of
Code project. The (source code of) module can be downloaded from grass
add-ons repository (vector/net.analyze). I recommend to download the
entire directory to avoid any compilation issues. Additionally, you
get an access to some latest network analysis modules! Anyway, simple
make command in the net.analyze directory should compile the modules
(and library). There is no documentation (yet), however, the interface
should be similar to the one used in v.net.path and/or v.distance.
Finally, here is a couple of nice pictures:

http://people.ksp.sk/~dano/grass/nd.png
http://people.ksp.sk/~dano/grass/ndt.png
http://people.ksp.sk/~dano/grass/ndtd.png

Blue and orange lines show the shortest length and time paths respectively.

Best,
Daniel

On Wed, Jul 1, 2009 at 5:56 PM, Moritz
Lennert<mlennert@club.worldonline.be> wrote:

On 01/07/09 04:44, J. Holden wrote:

Hello,

I am looking to use v.net.path to determine the distance of many
different points to many different other points on a network.

Is it possible to send multiple parameters to v.net.path? For
instance, I have (in theory) 4 points connected to a network. I want
to find the distance of the line segments between points 1 and 4, 2
and 4, & 3 and 4.

I want to: run v.net.path once by passing multiple parameters; get
vector line output of each of these three paths found by v.net.path
in one output file; calculate the distance of each line from the file
using v.to.db.

Since this is not a module of GRASS which I have worked with in the
past, I am wondering if this is possible.

Sure, as mentioned on the man page:

"Nodes can be piped into the program from file or from stdin. The syntax is
as follows:

id start_point_category end_point_category

or

id start_point_x start_point_y end_point_x end_point_y"

So to take your example, and assuming that 1,2,3,4 are category values of
existing points:

Create a file containing:

1 1 4
2 2 4
3 3 4

and feed it to v.net.path with the file= parameter.

You will then get one vector map with severals lines which have the category
values used in the first column of your file.

Moritz
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

(attachments)

break.jpg