[GRASSLIST:883] Re: What is the distance tolerance for v.what.vec t?

Hamish hamish_nospam at yahoo.com
Wed Apr 26 00:21:48 EDT 2006


> >I take it you know start/end times and will interpolate intermediate
> >postions and times?

> Sorry I didn't explain things better. Yes, I'm trying to interp times
> for intermediate positions given known start/end times and positions.
> I started with a shapefile of start/end points, imported to Grass, and
> then digitized lines connecting the start/end points with v.digit. I
> used v.to.points as you said to create intermediate points along the
> track. However, since the trackline was digitized by me and not
> topologically related to the start/end points, I was having trouble
> getting v.what.vect to 'grab' the attributes of the original start/end
> points and copy them to the start/end points of my digitized line. 

It would be more exact to use "v.in.ascii format=standard" to do the
line creation:

v.in.ascii -n format=standard 
L
 x1 y1
 x2 y2
L
 x3 y3
 x4 y4
L
...

See the v.in.ascii help page, e.g. for adding category numbers to the
lines. See v.in.garmin for an example of then connecting attributes
to the new lines. (yes, the awk is thick)



> The man page for v.what.vect says that it is 'based on v.distance' and
> grabs attributes from nearby vectors, but you can't specify a dmax
> parameter for the v.distance call when using v.what.vect (assuming
> there is a v.distance call), which was the mangled thrust of my
> initial post. Cutting out the middleman, I just used v.distance
> directly, which worked fine. Maybe we should mention what the
> "default" dmax param is set to for the v.distance call inside
> v.what.vect on the v.what.vect manpage?

look at the v.what.vect script:
 GRASS> less `which v.what.vect`

and you'll see it IS just a simple frontend to v.distance for the the 
special case where you want to "Upload vector values at positions of 
vector points to the table".

the critical line is:
v.distance from=$GIS_OPT_VECTOR to=$GIS_OPT_QVECTOR
column=$GIS_OPT_COLUMN \
   to_column=$GIS_OPT_QCOLUMN upload=to_attr dmax=0 \
   from_layer=$GIS_OPT_LAYER to_layer=$GIS_OPT_QLAYER

dmax is always 0.
I've updated the v.what.vect help page to make this clearer.

v.distance's default is unlimited search distance:
   dmax   Maximum distance or -1 for no limit.
          default: -1


> >see also Radim's v.lrs.* modules, new in CVS.
>
> ps, thanks, I'll check out v.lrs* modules

Useful if you want "distance from start of transect".


Hamish




More information about the grass-user mailing list