Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract points to some distance origin to destination? #142

Open
navotera opened this issue Oct 8, 2020 · 1 comment
Open

Extract points to some distance origin to destination? #142

navotera opened this issue Oct 8, 2020 · 1 comment

Comments

@navotera
Copy link

navotera commented Oct 8, 2020

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant