[GRASS-user] weird results from v.distance's to_angle

Hamish hamish_b at yahoo.com
Fri Jan 13 02:47:57 EST 2012


Hi,

I'm getting some weird results from G6's v.distance upload=to_angle.
before filing a bug report I thought I'd check if I'm just confused..

v.to.db seems to be lacking an "option=angle" to check against for
the v.distance output connecting line map? (I guess I could do trig on
the option=start,end coords to get that)

also, I couldn't get it to work with fields (areas) as a v.distance to=
map, only the roads (lines) map worked. ?? (otherwise output connecting
line map was just the starting point coords)


#spearfish

# make a local copy of a points map
g.copy vect=archsites,arch_pts

# add some empty attribute columns
v.db.addcol arch_pts column='distance DOUBLE, theta DOUBLE'

v.distance from=arch_pts to=roads output=arch2road_lines \
  upload=dist,to_angle column=distance,theta --o

v.db.select arch_pts column=distance,theta


d.mon x0
d.vect roads col=grey
d.vect arch2field_lines col=red width=2
d.vect arch_pts color=blue icon=basic/circle



[v.distance]
to_angle: angle between the linear feature in 'to' map and
    the positive x axis, at the location of point/centroid
    in 'from' map, counterclockwise, in radians, which is
    between -PI and PI inclusive

d.what.vect arch_pts

# cat 12: road is due south of point. theta ~= 0.03
# cat 17: road is due west of point.  theta ~= pi/2  ( 1.586829)
# cat  2: road is just WNW of point.  theta ~= -pi/2 (-1.646191)
# cat 14: road is NE of point.        theta ~= -pi/2 (-1.635028)

(cats 23 and 19 attach to the same road terminus)
# cat 23: road is SSW of point.       theta ~= pi/2  (1.647741)
# cat 19: road is SW of point.        theta ~= pi/2  (1.647741)
  -- here the angle is reported identical ?!?


these angles do not match the description of theta measured CCW from the
+x axis ...?


confused,
Hamish


More information about the grass-user mailing list