Generating OSM tiles with Python to Windows Azure Blob storage

Tags: OpenStreetMap

The concept is to generate the tiles for an OpenStreetMap or OpenSeaMap server published to Windows Azure. The advantage of Windows Azure Blob storage is that we can enable the CDN support (content delivery network) to send the tiles more quickly to the visitor.

Download and modify it in 3 places to hold your account keys and change the functions to use the real storage and not the development versions. Don’t change the CLOUD_BLOB_HOST value!

DEVSTORE _SECRET_KEY=”yoursecretkey”
Class BlobStorage, change the host to CLOUD_BLOB_HOST

Test by calling

Create a Windows Azure blob container (in this scenario named “testcontainer”)

edit “”

Add the following at the top:

from windowsazurestorage import *

find the function “def render_tiles” and at the last line after the,’png256′) add:

blobs = BlobStorage()
name = str(z) + “/” + str(x) + “/” + str(y) + “.png”
blobs.put_blob(“testcontainer”, name, im.tostring(‘png256′), “image/png”)

Run and watch the tiles appear in your Azure Blob Storage