4

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.

2

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.

2

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.

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.