Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get address from Geocode latitude and longitude

For the bulk of my application, I am getting the latitude, longitude, postal code, etc of a town/city from Geocoder. I am just putting in the city and state and in return I am getting

I am in a scenario where I have a venue. That venue needs an address and I am getting that venues latitude and longitude from another source. Using the Geocoder gem, am I able to get an address by giving it a latitude and longitude?

like image 790
user2184718 Avatar asked Dec 29 '13 16:12

user2184718


Video Answer


1 Answers

Run in Rails console.

latitude = 40.0397
longitude = -76.30144
geo_localization = "#{latitude},#{longitude}"
query = Geocoder.search(geo_localization).first
query.address
like image 178
rplaurindo Avatar answered Nov 15 '22 07:11

rplaurindo