[gdal-dev] Lat/long & distance/heading calculation

Gerretsen, A. agerretsen at nlr.nl
Tue Jan 29 04:40:02 EST 2008


Sorry for hijacking this discussion a bit, but we have a similar problem.

We are sort of doing to inverse of the issue mentioned here. We have an aircraft at a certain position and to that
aircraft a camera is attached looking at another position.

In the software we have these positions in XYZ coordinates (for example UTM), but if we calculate the heading wtih those
it is relative to the "grid north" of the projection used. That is not what we need to send to our visual, which needs
them relative to "true north". Is there an easy way to convert between those two?

Arno


-----Original Message-----
From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Ray Gardener
Sent: 29 January 2008 01:56
To: Meek, Allan (Contractor)
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Lat/long & distance/heading calculation

If you can use UTM or similar coords, then

x = cos(heading) * distance + start_pos_x
y = sin(heading) * distance + start_pos_y

Assuming heading in clockwise radians with north = up.

Then you can inverse transform (x, y) from UTM to lat/lon.

Ray


Meek, Allan (Contractor) wrote:
> This is a bit of a long shot, but I'm hoping I might find some help
> here. 
> 
> I have a start lat/long position, a distance, and a heading. Is there an
> easy way (in OGR or elsewhere) to calculate the end lat/long position
> (after travelling the given distance on the given heading)?
> 
> I have a working formula for calculating the distance and heading
> between two lat/long positions, but I wanted to see if I can get around
> having to rework this to solve my problem.
> 
> Any help would be appreciated!
> 
> Thanks,
> Allan
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> 

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list