[GRASS-user] Grass Graphic Model v.net.distance Not Accepting point layer in From or To fields

Moritz Lennert mlennert at club.worldonline.be
Thu Dec 2 03:42:05 PST 2021


Hi Joshua,

Am 24.11.2021 00:23 schrieb Joshua Geoghegan:
> Hi Moritz,
> 
> When I set it to layer 2 (which is the point layer I connected) and
> close the v.net.distance dialog, and reopen it I see the form reload
> and it switches back to 1.
> 
> I also try to create the where clause and now it says no table linked
> to layer 2 even though I linked it with v.db.connect.

There is no v.db.connect in the commands you list in the attached image.

> Below are the steps up until v.net.distance, with my network being
> cleaned up beforehand.

Please if in any way possible include the commands in a text (not image) 
form. That makes it much easier to add targeted comments and responses.

> 
> The highlighted section is where I import the points up until the
> v.net.distance.

Your v.import and v.net seem ok (assuming that a threshold of 2 is 
enough to cover all points you want to connect).

> I probably don’t need the v.db.addtable. That was there so I could
> populate the distance for each route but I guess v.net.distance
> outputs that.

Yes. From the man page:

"A table is linked to output map containing various information about 
the relation. More specifically, the table has three columns: cat, tcat 
and dist storing category of each from feature, category of the nearest 
to feature and the distance between them respectively."

So, the important part is the v.net.distance call. Several remarks:

- Your from_layer and to_layer should be = 2 since that is where your 
points are.
- In your original mail you spoke about calculating shortest path 
between one point and all others. If that is still the case you have to 
either use from_cat and to_cat to select based on category values, or 
use from_where and to_where to select based on attributes.
- If you want to use attributes, you have to use v.db.connect to connect 
the table linked to your original point map to the node layer in your 
network map.

> It still didn’t work when I removed that.

When you say it didn't work, what exactly happened ?

Moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 35619 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20211202/de1f4661/attachment-0001.png>


More information about the grass-user mailing list