hackforwesternmass/cultural-map

OSM Data

JamesChevalier opened this issue · 0 comments

You might be able to use OpenStreetMap data to add all of the locations that have been mapped there to your database. Then you can query your database for locations within certain distances of a lat/lon location.

geokit-rails provides a way to search for things within, in_range, in_bounds, closest, and by_distance from another thing. Another gem that's good for geo stuff is geocoder.

You can take a look at [https://gist.github.com/JamesChevalier/5379574](this gist) to get an idea of how to pull data out of the .osm files. That gist is from this post about parsing OSM data. You might be able to use that script as-is!

Here are the .osm files for Holyoke and Northampton.

When you process the .osm files with the script, it will output .json files which can be imported into the database. You'll need to work through that part yourself, but it should be pretty simple.