Latitude and Longitude check with in range

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Latitude and Longitude check with in range

honey ruby
Hi ,

I have city or county Lat and Long and if user inputs of lat and long are with in the city or county which I specify then I should allow him for next page else I need to block him and say we are not serving at that place. Using Geocoder I don't see any method to check lat and long with in range. Can any one help me how can I do this.




Thanks in advance

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9bf705b2-7a94-419c-97f6-c0c084dc7763%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Latitude and Longitude check with in range

Hassan Schroeder-2
On Sat, Jun 9, 2018 at 12:42 AM, honey ruby <[hidden email]> wrote:

> I have city or county Lat and Long and if user inputs of lat and long are
> with in the city or county which I specify then I should allow him for next
> page else I need to block him and say we are not serving at that place.
> Using Geocoder I don't see any method to check lat and long with in range.

A Range is standard Ruby, nothing Geocoder-specific about it.  What
does an example lat/long "range" look like?

Otherwise, is there some reason Thing.near() doesn't work for your
use case?

--
Hassan Schroeder ------------------------ [hidden email]
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBUhbx59GFBRKNXEOjAHs_sHv6KO1%2B%3DRNYd-vGj1VNUKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Latitude and Longitude check with in range

David Merrick
Hi Hassan.

You will need to specify a collection of points that define an area.ie County or City




On Sun, Jun 10, 2018 at 1:41 AM, Hassan Schroeder <[hidden email]> wrote:
On Sat, Jun 9, 2018 at 12:42 AM, honey ruby <[hidden email]> wrote:

> I have city or county Lat and Long and if user inputs of lat and long are
> with in the city or county which I specify then I should allow him for next
> page else I need to block him and say we are not serving at that place.
> Using Geocoder I don't see any method to check lat and long with in range.

A Range is standard Ruby, nothing Geocoder-specific about it.  What
does an example lat/long "range" look like?

Otherwise, is there some reason Thing.near() doesn't work for your
use case?

--
Hassan Schroeder ------------------------ [hidden email]
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBUhbx59GFBRKNXEOjAHs_sHv6KO1%2B%3DRNYd-vGj1VNUKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Dave Merrick

Daves Web Designs

Website http://www.daveswebdesigns.co.nz/

Email [hidden email]

Ph   03 216 2053

Cell 027 3089 169

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2B%3DMcKYZhqiBnhOyvNV_gppTSG%3DHNg3%3DXTjgHh0rktt3qBOxWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Latitude and Longitude check with in range

David Merrick
In reply to this post by Hassan Schroeder-2
Define a set of list of points set([lat,long],...) or [ [lat,long],...]

If location in set or list accept

else

block

On Sun, Jun 10, 2018 at 1:41 AM, Hassan Schroeder <[hidden email]> wrote:
On Sat, Jun 9, 2018 at 12:42 AM, honey ruby <[hidden email]> wrote:

> I have city or county Lat and Long and if user inputs of lat and long are
> with in the city or county which I specify then I should allow him for next
> page else I need to block him and say we are not serving at that place.
> Using Geocoder I don't see any method to check lat and long with in range.

A Range is standard Ruby, nothing Geocoder-specific about it.  What
does an example lat/long "range" look like?

Otherwise, is there some reason Thing.near() doesn't work for your
use case?

--
Hassan Schroeder ------------------------ [hidden email]
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBUhbx59GFBRKNXEOjAHs_sHv6KO1%2B%3DRNYd-vGj1VNUKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Dave Merrick

Daves Web Designs

Website http://www.daveswebdesigns.co.nz/

Email [hidden email]

Ph   03 216 2053

Cell 027 3089 169

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2B%3DMcKad%3D2wU%2BTQz89VU%2B-jDvBmHbdZnq%2BPmSdcO4SKL2c3iEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Latitude and Longitude check with in range

Hassan Schroeder-2
In reply to this post by David Merrick
On Sat, Jun 9, 2018 at 1:44 PM, David Merrick <[hidden email]> wrote:
> Hi Hassan.
>
> You will need to

Uh, no, not my question.

--
Hassan Schroeder ------------------------ [hidden email]
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAa-PuYtBzLZWtxQb1yMvBBrxdus2QYwyX1WVm2DNU9_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Latitude and Longitude check with in range

Ryan-2
In reply to this post by honey ruby
Honey,

Geocoding refers to the translation of an address to a lat/lng or vice-versa.
If you're looking to determine if a lat/lng is within a City or County shape, you're probably looking for something like a Point-in-Polygon search - to ensure the lat/lng is within a given boundary.
Rails offers nice `PostGIS` support. https://postgis.net/docs/manual-1.4/ST_Contains.html
There are likely other options as well, depending on where you store your shapefiles.

- Ryan


On Saturday, June 9, 2018 at 12:42:06 AM UTC-7, honey ruby wrote:
Hi ,

I have city or county Lat and Long and if user inputs of lat and long are with in the city or county which I specify then I should allow him for next page else I need to block him and say we are not serving at that place. Using Geocoder I don't see any method to check lat and long with in range. Can any one help me how can I do this.




Thanks in advance

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ff3c349c-b580-4d96-a154-0ed930cd44a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.