[GRASS-dev] v.net.path

Markus Neteler neteler at itc.it
Thu May 3 07:24:33 EDT 2007

On Thu, May 03, 2007 at 08:32:00PM +1200, Hamish wrote:
> > > Markus wrote:
> > BTW: the v.clean step therein fails - it does NOT properly
> > connect the lines. Sigh.
> Is that where this v.net.path error comes from?
> WARNING: Point with category [10] is not reachable from point with category
>          [9]
> WARNING: [1] destinations unreachable (including points outof threshold)
> Building topology ...
> 0 primitives registered      
>  * "[1] destinations unreachable" reads weird as "1" is not parenthetical

fixed in CVS.
> This is because "connect" lines are missing any cat values. v.clean (and
> almost all vector modules) work by cycling through the list of cats. You
> have to use v.category to give them a cat before going on. I have forgotten
> to do this enough times that now I always remember it.

Haha!! OK, this wasn't really clear to me. Unfortunately there is
no error message/warning indicating this.
See my other mail concerning v.db.addtable.

> [...]
> v.db.addtable connect  ...
> # use cat 0 (no data) for both roads as "off-road" ?
> v.category in=connect out=connect_cat cat=0 step=0
> # not sure if this is needed later?
> # v.db.update won't work for a insert? add a -i flag to it? new module?
> echo "INSERT INTO connect_cat (cat, label, forward, backward) VALUES (0, 'no data', 50, 50)" | db.execute
> v.db.select connect
> v.db.select connect_cat
> [...]
> then I get a nice mypath vector and no error from v.net.path.

Now me, too! :)

I have updated the example in CVS.
Still the chosen path looks a bit weird to me, maybe the speed
limits (mph) are chosen badly.

> > I have added some examples based on Spearfish:
> > v.net.iso/description.html
> > v.net.path/description.html
> > 
> > They need testing and simplification (v.net.path).
> > My problem is how to get the nodes (centers) onto the
> > network lines. Maybe we should implement threshold such
> > as in d.path? If you look at the v.net.path, you see that
> > it is rather painful to connect the node to the network.
> > Or some fancy v.edit trick to digitize the start/end
> > nodes?
> v.net.iso: the v.clean step also removes the point patched into roads_n ?

Good question. Maybe Martin has an idea? I guess it survives since
it is a different vector type.

> v.net.path:
> "Shortest path from two digitized nodes" example
> also try:
>   d.path -b roads coor="601653.5,4922869.2","593330.8,4924096.6"
> and
>   d.path -b myroads_net coor="601653.5,4922869.2","593330.8,4924096.6" \
     afcol=forward hcolor=green

How cool, I didn't realize this -b flag so far.
The difference is striking. I am not really sure about the second one.

> [I do get a segfault from d.path if I spell the af column name wrong.]

Same thing for v.net.path. Perhaps we need a global sanity check
for column names. Maybe with db_get_column()?


PS: Amazing, where the v.net.iso suggestion for streams gets us :)

More information about the grass-dev mailing list