Giter Site home page Giter Site logo

Comments (3)

mrJean1 avatar mrJean1 commented on August 27, 2024 1

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.

sbonaime avatar sbonaime commented on August 27, 2024

I find a python solution here
https://www.geeksforgeeks.org/minimum-distance-from-a-point-to-the-line-segment-using-vectors/

from pygeodesy.

mrJean1 avatar mrJean1 commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.