# [gdal-dev] Geodetic Problem

Frank Warmerdam warmerdam at pobox.com
Tue Mar 16 17:13:29 EDT 2010

```David Baker (Geoscience) wrote:
> Frank and the List,
>
>
>
> I have a geodetic problem I hope GDAL/OGR can solve.
>
>
>
> The setup:
>
>
>
> I have two radio towers each the same height and at the same elevation
> being 10,000 meters apart.  I know the latitude and longitude of the
> first tower and those coordinates reference WGS84 (though they could be
> any geographic CRS, NAD27, NAD83, etc.).  I also now the baring to the
> second from the first measured from true north at the first tower.
>
>
>
> The problem:
>
>
>
> Given the above information and using the prebuilt tools, GDAL/OGR
> utilities, what workflow would one use to calculate the latitude and
> longitude of the second tower?
>
>
>
> The hints I have gotten so far say to use a conformal projection (UTM
> maybe?) centered at the first point with a scale factor of 1, a local
> projection.  Calculate the Cartesian offsets from the first point to the
> second based on the azimuth of the given baring.  Using the baring
> calculate the x and y offsets to the second point and use offsets to
> find the x and y of the second point in the local coordinate system.
> Then, reproject the x and y of the second point to the latitude and
> longitude in the CRS of the first points latitude and longitude.  If
> this is correct, I guess the question is, what would the proj4
> parameters be for such a local projections.

David,

The above will give a pretty good approximation, degrading as the
distance increases.  However, the proper way to do this is using
great circle operations.  The PROJ.4 "geod" program can do this:

http://trac.osgeo.org/proj/wiki/man_geod

http://trac.osgeo.org/proj/wiki/GeodesicCalculations

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

```