Google Summer of Code/2012/Data Tile Service
The goal of this project is to make OSM data accessible as tiles, similar to map image tiles. The implementation will be both a publicly accessible data tile service and an application which users can set up on their own servers that can be configured to produce customized data tile sets.
Customizations will include things like:
- Filtering map elements by tag
- Filtering the tags which appear on elements
- Simplifying geometry
- Combining elements
- Different subsets of data available at different zoom levels
The basic architecture of the service will feature a replica of OSM data in an SQL database (with GIS extensions) kept up to date with diffs. As diffs are applied, affected tiles will be regenerated by querying the database. Tiles will be written to disk or optionally uploaded to a server for hosting.
Client-side map rendering
- Requires small file sizes, but with enough information to draw the map
- Different subsets of data at different zoom levels -- and different levels of detail for ways, etc. at different zoom levels
- Must deal with coastlines
- Want to support a similar interface as Potlatch, where editable features are displayed as vector shapes, and are clickable
- Could include only geometry, ids, and versions of editable features -- tags could be loaded from the API once a user selects a feature
- Geometry can be simplified, and nodes can be combined -- a given map feature in this tile set could possibly refer to multiple nodes (at lower zoom levels)
- Fewer features available for editing at lower zoom levels -- for example, click on a city to edit population figures
Client-side interactivity, such as clickable points of interest
- Layer over image tiles
- Clickable points of interest -- show opening hours for a shop, etc.
- Subset based on tags
File size is a major constraint. Use cases discussed above are mostly for web browsers, so json makes sense (easy to parse, concise). json or jsonp? configurable?
Similar to kothic js tile format -- like geojson, with modifications to make file sizes smaller
- positions inside tile are given as offsets from a corner
- could also shorten property names (ie "coordinates" -> "c")
- should be easy to convert to proper GeoJSON for use with Leaflet, etc.
(Added by Graham Jones while I am trying to get it working - Michael may correct my mistakes for me!) Source code stored at 
To get it to run on Ubuntu Linux you need to do:
- sudo apt-get install ruby rubygems
- sudo gem install pg
- sudo gem install sinatra
- sudo gem install json
Note you get some errors about not being able to install documentation, but the code seems to install...
You can then run script/render --tile 10/1/1