Comments (3)
Use LatLon method nearestOn the find the closest point. Then, use the distanceTo method to find the distance.
In addition, there are separate functions called nearestOn
in the ellipsoidal and spherical modules and there are quite a few distance functions in module formy, named after the method employed.
from pygeodesy.
I find a python solution here
https://www.geeksforgeeks.org/minimum-distance-from-a-point-to-the-line-segment-using-vectors/
from pygeodesy.
A few more comments. The mechanism to find the closest point on a line or line segment is different for ellipsoidal and spherical LatLon method nearestOn
.
Method sphericalTrigonometry.LatLon.nearestOn
indirectly calls function nearestOn5 which uses the equirectangular approximation to compare distances.
Ellipsoidal nearestOn
methods iterate and convert back and forth between geodetic and cartesian coordinates and use vectorial function vector3d.nearestOn
** to get the closest point based on the dot
product (in an azimuthal equidistant projection). For more details, see the references in ellipsoidal method intersections2.
__
**) That function is not public
, a mistake. All 4 ellipsoidal modules export a function called nearestOn
and both spherical modules have one named nearestOn3
.
from pygeodesy.
Related Issues (20)
- Typo in pygeodesy/sphericalTrigonometry.py HOT 2
- `initialBearingTo` returns wrong values for points on same meridian HOT 2
- EcefKarney.forward method error HOT 3
- intersection HOT 4
- Paths intersection. HOT 1
- Intersection of 2 polygons HOT 7
- Problem with boundsOf function HOT 1
- Utm Error | pygeodesy.mgrs.MGRSError: band (''): MISSING HOT 2
- missing g2012b_bin HOT 7
- "help wanted" converting between ellipsoidal and orthometric to calculate height above ground HOT 5
- Geographiclib 2.0
- [Q/A] Obtaining relative trajectory using GPS co-ordinates? HOT 1
- Suggestion: geodesic equation HOT 8
- Parsing Polar MGRS Coordinates HOT 5
- Problem with calculating area in sphericalTrigonometry HOT 4
- DEPRECATED Ned from pygeodesy.ellipsoidalNvector HOT 5
- Question about bearing HOT 11
- Question About Obtaining Rotation Matrices HOT 4
- Install error 'geodesy/sphere.pyx' doesn't match any files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygeodesy.