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.
Links
Timeline
Week | Milestones |
---|---|
Week 1 |
|
Week 2 |
|
Week 3 |
|
Week 4 |
|
Weeks 5-7 |
|
Week 8 |
|
Weeks 9-11 |
|
Week 12 |
|
Use cases
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
Editors
- 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
Tile format
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.
Source Code
(Added by Graham Jones while I am trying to get it working - Michael may correct my mistakes for me!) Source code stored at [1]
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