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

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.

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!

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!

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.