Yes, that is an important concession to make - sometimes, it is easier to 
deal with the underlying coordinates directly than it would be to handle 
OLCs or any other representation. :)
The process I outlined above can still be useful to trim a dataset by an 
order of magnitude or two, before a more exact calculation is performed on 
the remaining candidates.

On Tuesday, March 26, 2019 at 8:02:26 PM UTC+1, Rasťo Šrámek wrote:
>
> I'd simply decode the plus codes into lat/longs and then calculate the 
> distance between the center point and all points, sort by that distance, 
> and cut off. As Andreas points out, you need to worry about latitude: the 
> distance from (a, b) to (c, d) is roughly sqrt((|a-c|*111.12)^2 + 
> (|b-d|*cos((a-c)/2)*111.12)^2) if you (a,b) and (c,d) are close enough. If 
> not, you can use a library such as S2 <http://s2geometry.io/> to do the 
> calculations on a sphere/geoid.
>
 

-- 
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
--- 
You received this message because you are subscribed to the Google Groups "Plus 
Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-location-code+unsubscr...@googlegroups.com.
To post to this group, send an email to open-location-code@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/open-location-code/f9207518-094f-40a2-96bd-76fa6a4e02d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to