Giter VIP home page Giter VIP logo

Comments (2)

michaelkirk avatar michaelkirk commented on July 1, 2024

I'm sorry but I don't understand your question. Can you try to rephrase it or give a more specific example?

The docs for Indeterminate if you haven't seen them: https://docs.rs/geo/latest/geo/enum.Closest.html#variant.Indeterminate

from geo.

kraktus avatar kraktus commented on July 1, 2024

Sorry, some words got missing in my issue. When there is an "infinite number of closest points", is there a way a method that retrieves one of those?

My real use case was:

  • I want to compute the haversine distance between a point and a polygon, but since it is not defined, I approximate it by
  • Computing the closest point between the polygon and the point
  • computing the haversine distance between one polygon and the closest point of the polygon

extract from my code

// licence: AGPLv3
            let arp_pt = airport.to_point();
            let Closest::SinglePoint(closest_point) = polygon.closest_point(&arp_pt) else {
                panic!("no closest point")
            };
            let distance_m = arp_pt.haversine_distance(&closest_point) as usize;

In case of of Indeterminate, I would be fine with any one of closest points. For now I bailed out, fortunately it didn't happen in practice

from geo.

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.