Re: Find nearest geographic coordinates
Ivan Uemlianin <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <[email protected]> |
Ooh interesting. Well there's your answer, although if you're always using it for `distance(A, X) < distance(B, X)` you could probably simplify the arithmetic. Ivan On 25/11/2020 22:09, Frank Muller wrote: > I’m new to GIS field, but this module states that Euclidian distance > isn’t accurate compared to “Law of Haversines”: > > https://github.com/armon/teles/blob/master/src/teles_geo_query.erl#L87-L102 > > > /Frank > > Wed 25 nov. 2020 à 22:45, Ivan Uemlianin <[email protected] > <mailto:[email protected]>> wrote: > > Hi Frank > > Do you want to sort the list by Euclidean distance from X? If so, > could > you use lists:sort/2? > > Ivan > > > On 25/11/2020 21:38, Frank Muller wrote: > > Hi guys, > > > > I've a list of geographic coordinates: > > > > L = [ {{<<"longitude">>,6.1457}, {<<"latitude">>,46.2022}}, > > {{<<"longitude">>,2.3387}, {<<"latitude">>,48.8582}}, > > ... ] > > > > and a specific coordinate X = {{<<"longitude">>,-73.5848}, > > {<<"latitude">>,45.4995}}. > > > > Question: how can i find the nearest coordinates to X from L > (sorted > > from the nearest to the farest)? > > > > /Frank > > -- > ============================================================ > Ivan A. Uemlianin PhD > Llaisdy > > Ymchwil a Datblygu Technoleg Lleferydd > Speech Technology Research and Development > > [email protected] <mailto:[email protected]> > @llaisdy > llaisdy.wordpress.com <http://llaisdy.wordpress.com> > github.com/llaisdy <http://github.com/llaisdy> > www.linkedin.com/in/ivanuemlianin > <http://www.linkedin.com/in/ivanuemlianin> > > festina lente > ============================================================ > -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Ymchwil a Datblygu Technoleg Lleferydd Speech Technology Research and Development [email protected] @llaisdy llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin festina lente ============================================================