Comments (7)
That was significantly shorter than a few weeks
from pygeodesy.
Correct, there was an issue and that has been fixed. Also, there were no tests for that method and there are now, including your example. Thank you for reporting the issue.
from pygeodesy.
from pygeodesy.
Hi Jean,
Further testing with new version shows the issue is only partially resolved.
I've written this simple function to calculate the distance of a point from a segment.
def dist_p_ab(p, a, b):
"""Calculate distance (in radians) from point p to segment (a, b)"""
n = p.nearestPointOnSegment(a, b)
d = p.distanceTo(n, radius=1)
return d
I've then tested this with a segment (a = LatLon(20, -40); b = LatLon(40, 60)
) and a grid of latitudes and longitudes spanning the entire globe (lat = np.arange(-90, 90, 1); lon = np.arange(-180, 180, 1)
), and rendered the results as an image using matplotlib.
The following (unrelated) code also illustrates the issue:
>>> from PyGeodesy.geodesy.sphericalNvector import LatLon
>>> LatLon(10, -140).nearestPointOnSegment(LatLon(0, 20), LatLon(0, 40))
LatLon(00°00′00.0″N, 140°00′00.0″W)
It seems like current implementation is failing for a subset of points.
Cheers,
Eilam
from pygeodesy.
This is suspicious and I'll need to look into this further. It may take a few weeks, though.
from pygeodesy.
Courtesy of the original author, antipodal points (on the same hemisphere) are now handled in the sphericalNvector.LatLon method isWithinExtent.
from pygeodesy.
Nice visualisation!
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
- Find the shortest distance between a point and line segments (not line) HOT 3
- 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.