[GRASS-user] visited lines
Moritz Lennert
mlennert at club.worldonline.be
Mon Mar 24 09:10:51 PDT 2014
On 20/03/14 11:41, Annalisa Minelli wrote:
> Hi list,
> I have a maybe stupid question, but I should identify (by category) the
> net lines visited from going to one point to another along a net. I
> tried the v.net <http://v.net> module, but I'm not colpletely sure to
> have understood what the 'nreport' option for the parameter 'operation'
> does.
> I don't necessarily need to generate the path, I should only identify
> the visited lines by printing category..
I don't think there is a direct way of doing this (except possibly by
activating debugging and then filtering out the relevant info), but you
can do it through a combination of v.net.path, v.category and
v.distance. E.g. (using the North Carolina demo dataset):
v.net -s streets_wake points=schools_wake out=network op=connect thresh=500
echo "1 166 1" | v.net.path -s network out=mypath
#The result is a map with the same category value for all segments, but
we need different category values for each segment
v.category mypath op=del out=temp
v.category -t temp op=add out=mypath_segs
v.distance -p from=mypath_segs to=network upload=cat col=segcat
#The result should be (I didn't verify) the list of the cat values of
the lines in network that the path goes through.
#If you need another attribute of these lines, just use upload=attr and
tocolumn= in the v.distance call.
Moritz
More information about the grass-user
mailing list