Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I Geocode location with either address or Lat / long

Joe Minock asked in Rails

I'm building a portfolio app where a user can share all of the locations that they like to work from. A location can be a home, office, coffee shop, park or some random place in the wilderness. Given the prior criteria, I'm trying to figure out how best to geocode the location given either an address input or lat /long. I know there are many gems out there that do it, but many seem to be out of date.

Any and all help is appreciated.

Ideally, I'd like to have a user be able to enter either an address or lat, long into the address field and have the location processed from that input.

Reply

Okay ladies and gents, I'm going to self resolve this one. I had found documentation that made the Geocoder Gem look out of date. After further review, it is actually quite current.

Specific to my ask. you can enter a major landmark, address, or lat/long into an "address" field and it will identify the location. Pretty cool!

Reply

Yeah, I was going to suggest the geocoder gem. It's probably the only one I've used over the last few years and it works rather well. Documentation isn't super duper great, but it's not bad.

Let me know if you have any questions on it!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.