Open Street Maps with Ruby on Rails
Ruby JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
lib
log
osm_rails
public
script
test
vendor
.gitignore
.gitmodules
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru

README.md

Open Street Maps with Rails

The objectives of this project are to show how to

1. Access OSM data from PostGIS using ActiveRecord
2. Show the data on a map displayed using OpenLayers

Uses

1. Rails 3.2.3
2. Passenger 3
3. PostgresSQL and PostGIS

Pre-requisites

You will need to generate some OSM tiles first.

I used Mapnik to generate the files for the city of San Francisco.

I found the process described here really useful.

The link above uses the Python mapnik library to render tiles. But really you don't need to worry about how mapnik works, all we want to achieve is serve our own OSM tiles and then show markers on it!

There are a good few other resources on how to generate tiles using mapnik. You could use any other means to generate the tiles from OSM data.

See the Commit Log for how I built this.