[GRASS-user] v.net.allpairs on PostgreSQL

Markus Metz markus.metz.giswork at gmail.com
Tue Mar 11 13:01:50 PDT 2014


On Tue, Mar 11, 2014 at 4:09 PM, Patrick S. <patrick_GIS at gmx.ch> wrote:
> Dear list,
>
> I hope you can help me to understand the behavior of GRASS for the
> following: I need calculate the network-distances for intersections in this
> network. What seemed easy, starts to get very tricky....
>
> My approach is shown below, but has following problems:
>
> 1.) As intersections need to be dedicated with a category, I extraced the
> intersection-points with v.net so that I can connect them to their network.
> (is this really needed?) The following execution of the command
> v.net.allpairs generated errors: I think this might be due to missing
> categories for the new points? But adding a table, connecting it to the
> layer and filling in categories resulted in errors concerning already
> existing attribute tables. Can GRASS handle several layers for one map in
> PostgreSQL at all?
>
> 2.) Exporting and reimporting is a bit hacky, but solves issue 1. After
> connecting this new pointlayer to the network, I get a map consisting of
> points and lines in the same layer, as expected by v.net.allpairs. However,
> I have the feeling that the categories are not distinct, so I have a point
> and a line with the same cat-values. I expect this to have an effect on
> v.net.allpairs? The command v.net.allpairs does run (with the code below),
> but the output is not at all clear: I get the expected number of objects in
> the table (square of number of points), but the categories start with "1",
> which is not even existing in my original network. So what will cat "1"
> stand for than and how can I get v.net.allpairs to use the category of the
> points in the output?
>
> My code runs on GRASS 6.4.3 from Ubuntu-Repos with PostgreSQL 9.1. as
> database.

v.net.allpairs does not work properly in GRASS 6. You need to use
GRASS 7 if you want to use this module.

Markus M

>
> #___network cleaning and extracting intersections connecting to new network
> v.build.polylines in=net_clean out=net_segm cats=first --overwrite
> v.net in=net_segm out=intersections op=nodes --o
> v.out.ogr in=network dsn="network.shp" type=point     #re-import to create
> pt_layer with category
> v.in.ogr dsn="network.shp" out=network_pt  type=point
> v.net gr_streets_clean points=network_pt op=connect thresh=200 out=network
> nlayer=1 --o
>
> #___ create o-d-table with costs
> v.net.allpairs in=network out=streets_shortpath_od af=cost_speed
> ab=cost_speed -a --overwrite
>
> I'd appreciate any hint!
>
> Patrick
>
>
> Patrick Schirmer,
> Institute for Transport Planning and Systems
> ETH Zürich
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list