[GRASS-user] import satellite data in Grass
Hamish
hamish_b at yahoo.com
Wed Jun 25 12:41:05 EDT 2008
Martina:
> >> What I also want to do, is measure distances and
> >> angles between objects on my images. For the moment I don't
> >> really see where to search for this kind of tools. I thought that
> >> it would be possible to draw lines and measure them and angles
> >> between them?
...
> d.measure works fine finally for measuring distances (even
> if I don't get to work the command line d.measure but only
> the one in menu of the Map Display).
> But I still don't have an idea about how to measure the
> angle between two of this drawn lines.
--this won't work correctly for lat/lon, only projected locations--
maybe the easies way is to use d.where (use middle mouse button to draw a line)
then take the two east and north coordinates:
# pythag hypot: a^2 + b^2 = c^2
distance = sqrt( (e2-e1)^2 + (n2-n1)^2 )
# angle: tan(theta) = opposite side of triange / adjacent side
theta = atan2(n2-n1, e2-e1)
$radians2deg:
theta_degrees = theta * 180/pi
# convert angle counterclockwise-from-east to clockwise-from-north:
heading = 90 - theta_degrees
if(heading < 0) then heading = heading + 360
you could write a little script to process all that from two mouse clicks.
d.where | awk ...
or
COORDS=`d.where`
.....
but that is left as an exercise for another day.
Hamish
More information about the grass-user
mailing list