Complete Ruby geocoding solution


SUBMITTED BY: jlolk3r

DATE: Jan. 19, 2016, 3:13 a.m.

FORMAT: Text only

SIZE: 1.2 kB

HITS: 1046

  1. Look up street addresses, IP addresses,
  2. and geographic coordinates
  3. "Eiffel Tower"
  4. place name or address → 48.8582, 2.2945
  5. latitude, longitude
  6. 44.9817, -93.2783
  7. latitude, longitude → 350 7th St N, Minneapolis, MN
  8. street address
  9. 24.193.83.1
  10. IP address → Brooklyn, NY, US
  11. street address
  12. Perform geographic queries using objects
  13. Hotel.near(”Vancouver, Canada”)
  14. find hotels near Vancouver
  15. @event.nearbys
  16. find other events near @event
  17. @restaurant.distance_to(”Eiffel Tower”)
  18. find distance from @restaurant to Eiffel Tower
  19. @restaurant.bearing_to(”Eiffel Tower”)
  20. find direction from @restaurant to Eiffel Tower
  21. Geocoder::Calculations.geographic_center([
  22. @brooklyn_bridge,
  23. @chrysler_building,
  24. @madison_square_garden])
  25. find geographic center of multiple places
  26. ActiveRecord Examples
  27. (Mongoid and MongoMapper are very similar; please see README for details.)
  28. Simple Geocoding by Street Address
  29. Given a Venue model with known street address, automatically fetch coordinates after validation and store in latitude and longitude attributes:
  30. # app/models/venue.rb
  31. geocoded_by :address
  32. after_validation :geocode

comments powered by Disqus