2

I'm looking for something very similar to those stack exchange GIS questions: Algorithm for offsetting a latitude/longitude by some amount of meters, How to convert (geodetic pose + cartesian offset) to geodetic position, Increment GPS coordinates by a certain distance given in meters [duplicate] and Quick way to determine if facing a given lat/lon pair with a heading, but I cannot get my head around to combine them for my specific question:

The most relevant would be the first one, but it refers to a specific vector/heading offset. What I'm looking for is a way to calculate an offset of some meters (less than 200 meters) for a point A, on the segment defined by this point A and another point B, having less than 1km of distance between them.

How can I apply the first answer of SE GIS with a calculation of heading (like the one in the last answer) in order to transpose point A for 100 meters in the direction of B?

  • 1
    Unless you're near the poles, for a distance this small, could you assume linearity instead of creating a great circle from A to B? If not, my github.com/barrycarter/bcapps/blob/master/bclib.pl#L3407 does what you want, but is overkill for short distances. – barrycarter May 11 '17 at 16:30
  • Thanks a lot. Actually I wouldn't mind having precision even if it's an overkill. To be honest I cannot completely understand your code but I guess it's a version of the one I've finally used : movable-type.co.uk/scripts/latlong.html . If you don't mind I'll answer my question by providing the link. – foxTox May 11 '17 at 17:24
  • Don't mind, go for it. – barrycarter May 11 '17 at 17:26
1

Actually I've managed to find a workaround even though I'm not sure if it makes sense.

By using the information from here I've first calculated the bearing between the two points and then used the result to calculate the Destination point given distance and bearing from start point.

Searching a little bit more I've seen that this is a pretty common solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.