Ruby on Rails Monday, August 20, 2018

yes, this seems to be working:
 b = Geokit::Bounds.from_point_and_radius([c.latitude, c.longitude],c.distance)
 p b.sw
        from = [hdr.loclat, hdr.loclng]
        to = [c.latitude, c.longitude]
        if(b.contains?(from)) ....

is this local calculation or does it make an API call?



On Fri, Aug 17, 2018 at 5:34 PM Hassan Schroeder <hassan.schroeder@gmail.com> wrote:
On Fri, Aug 17, 2018 at 12:59 PM, tom <tomabroad@gmail.com> wrote:

> does anyone know how to calculate that w/o using geo-api calls?

https://stackoverflow.com/questions/12966638/how-to-calculate-the-distance-between-two-gps-coordinates-without-using-google-m

1. Do the math yourself, or
2. Use the "geokit" gem  <= that'd be my choice :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBFps9wfXqiRTVXgxLBdwyo6WK7%3DO6vAVNgJpeMem-nbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMfnhROC_BYitzqH701kzBRg7JVz5mpYpGGuKMxMe-tgHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment