John
John

Reputation: 4372

Does the Geocoder Near method make geocode api calls to google

I'm storing all my location info (longitude and latitudes) in my database by getting the long/lat from client side geocoding to avoid the 2500 max geocoding daily limit.

I just want to confirm that using the near method provided by the geocoder gem when longitude and latitudes are provided does not make an external call to the Google Geocoding api.

For example:

Location.near([37.77, -122.41], 15)

where the location model has latitude and longitude for each location already stored should not have any need to make an external call. Right?

Thanks!

Upvotes: 0

Views: 1109

Answers (1)

Rishav Rastogi
Rishav Rastogi

Reputation: 15482

It has to geocode "San Franscisco, CA" to figure out their longitude and latitude. Then using those it creates the sql query which will be able to get that information.

Update: If you are using Lat and Lng, it won't query Google Apis.

Upvotes: 1

Related Questions