Tiledata2

From OpenStreetMap Wiki
Jump to: navigation, search

An implementation of the Tile data server using protocol buffers as the storage mechanism (similar to PBF file format).

Contents

Processing data

initialParse.py:

generateTiles.py:

Using data

getMap.py contains a library to retrieve the data for any tile

mobileEncoding.py has sample functions to display the map objects


Structure

Defined in this file

Download

http://svn.openstreetmap.org/applications/utils/export/tiledata2/

Running

Convert protocol buffer definition into actual python code

pb/generate.sh

Parse the OSM file

initialParse.py < data.osm

Put all the ways into their tiles

generateTiles.py

See/share the results

ls -lh data/map.dat

Display a sample tile

from getMap import *
printMap(getMap(16372,10891))

Use the data


from getMap import *
mapData = getMap(16372,10891)
for w in mapData.way:
  for t in w.tag:
    print "%s = %s" % (t.k, t.v)
  for n in w.node:
    print "%f, %f" % (n.lat, n.lon) # n.id also available
Personal tools
Namespaces
Variants
Actions
site
Toolbox