geotools icon indicating copy to clipboard operation
geotools copied to clipboard

Extract points to some distance origin to destination?

Open navotera opened this issue 4 years ago • 1 comments

Let say I have set of latitudes and longitude points which would be shaped as line on map which have total distance 20 km.

I want to extract only cordinate from 0 km point to 4 km so it will result by generating new set of lat-long points. In others case I need to extract from 3 km to 6 km.

How can I implement it with this library?

Thank you.

navotera avatar Oct 08 '20 10:10 navotera

This is a question for StackOverflow.

This can be done with a bit of linear algebra. Note that while the earth is not perfectly round, there isn't a formula that will work 100% for every inch of the earth but the answer below should be fine for almost every application.

https://math.stackexchange.com/questions/2045174/how-to-find-a-point-between-two-points-with-given-distance

See the last answer for a basic version in python, just convert it to PHP

Thank you. I need to wait if this can be achieved with this library.

navotera avatar Oct 24 '20 07:10 navotera