[Gdal-dev] geod: azimuth to degrees

Norman Vine nhv at cape.com
Fri Nov 3 13:36:49 EST 2006


Charlton Purvis writes
> 
> I have a painfully simple question to ask the group that will 
> undoubtedly expose my cartographic knowledge vacuum.  But be 
> that as it may, I'm stumped.  Fire some trig my way -- I can 
> take it.  But going from an azimuth to degrees is beyond my 
> grasp today.
> 
> Let's take the geod man page example as our example:
> 
> geod +ellps=clrk66 <<EOF -I +units=us-mi 42d15'N 71d07'W 
> 45d31'N 123d41'W EOF 
> 
> which gives the results:
> 
> -66d31'50.141"   75d39'13.083"   2587.504
> 
> where the first two values are the azimuth from Boston to 
> Portland, the back azimuth from Portland to Boston followed 
> by the distance.
> 
> Fantastic!
> 
> Now say that I'd like to draw a vector on top of Boston that 
> points to Portland.  (For my purpose, my points are located 
> much closer together, so I want to use geod to help me draw a 
> vector that is scaled by distance / time
> -- I'm drawing drifter buoys and tracks).
> 
> Don't I have enough info from geod to do that?  If so, how in 
> the devil can I get a single degree value to draw my little 
> vector from -66d31'50.141"
> 75d39'13.083"?


Hmm  looks like you reading the geod man page  good  :-)

"""Geod may also be used to determine intermediate points along either a
geodesic line between two points or along an arc of specified distance from
a geographic point. In both cases an initial point must be specified with
+lat_1=lat and +lon_1=lon parameters and either a terminus point +lat_2=lat
and +lon_2=lon or a distance and azimuth from the initial point with
+S=distance and +A=azimuth must be specified."""

And use the azimuth as returned from your first invocation with an
appropriate
Distance arg to get the 'scaling effect' that you want

HTH

Norman




More information about the Gdal-dev mailing list