5

Given a distance in metres (x) and two coordinate pairs in lat/lon format (which form a line segment), I am trying to find a point x meters from point 1 on the line segment between the two points.

I know that in order to use Shapely for this operation, I need to transform the points. Does it make sense to convert the lat/lon pairs to UTM and then use interpolate? If so, will it work to use metres as the measurement for distance, or will I need to convert that to something else as well?

I'm open to suggestions on the best way to go about using Shapely for this.

asked Apr 19, 2017 at 20:07
1

2 Answers 2

4

Yes, transform your points to UTM (with pyproj or whatever), make a Shapely LineString from them and then call its interpolate() method with the distance in meters: https://shapely.readthedocs.io/en/stable/manual.html#object.interpolate.

Mike T
42.7k10 gold badges131 silver badges194 bronze badges
answered Apr 21, 2017 at 7:14
0
3

you can use GeographicLib, check out the examples here. This answer was inspired by this one.

It will get you more accurate values than Cartesian interpolation (using UTM coordinates), and also you won't have to deal with the case of each point (point 1 and point 2) belonging to different UTM zones.

answered Jan 5, 2018 at 4:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.