Pyrender

From OpenStreetMap Wiki
Jump to: navigation, search
Pyrender
Screenshot of Pyrender
Author: user:Ojw
Platform: win ; macos ; linux
Pyrender is an on-demand map rendering framework, programmed in Python, written by User:Ojw. When it receives an HTTP request for a tile, it fetches the OSM data for the tile from OJW's tile data server, and renders the data as PNG.

The Pyrender code in the SVN repository does not work. Some of the reasons include:

Contents

Getting started

Check out pyrender from svn:

$ svn co http://svn.openstreetmap.org/applications/rendering/pyrender/

Start the tile server. You may need to install some prerequisites such as python, py-cairo.

$ cd pyrender
$ ./server.py

Visit http://localhost:1280/ with a web browser. To view the map of somewhere other than London, you can edit the coordinates of a permalink.

Creating a custom slippy-map

Before pyrender

Method A:

Method B:

After pyrender

Technical stuff

Pyrender system.png

Getting tile data

We need someone to run a server for this - see tile data server

Limitations

TODO

Screenshots

These are from renderer_default.py, which is a cairo renderer handling ways and areas:

Default layer, which is mainly roads, railways, footpaths


Water network, showing riverbanks, docks, coastlines, etc.

Pyrender docklands water.png

Borders layer (these are local borders of Camden, Westminster, etc. inside London):

Pyrender london borders.png

Zoom out a bit, and it starts merging tiles together to get enough data:

Pyrender motorway.png

Metro rail systems, showing the London Underground

Pyrender metro lines.png

Railway network layer, including railway station outlines:

Pyrender rail network.png

Features without a name (debug layer) (note: this shows all features without name tag, not just roads):

Pyrender noname.png

Building layer, being displayed on top of the default layer

Pyrender buildings.png

Rendering libraries

Base-classes are available for:

  1. Cairo (graphics)
  2. Python Imaging Library

however, each rendering module chooses which base-class to use (and in many cases, calls the graphics library functions itself), which means that in practice you have to have the right library installed for whichever renderer you want to run

Future work

See also

Personal tools
Namespaces
Variants
Actions
site
Toolbox