I am interested using a slippy map to download OSM tiles. In doing so, I intend to stay within OSM tile usage policies (such as setting up my own tile server, or renting space from a commercial server) for high volume use). I noticed the official openstreetmaps.org slippy map has an 'export' tab, grabbing sections of map at a given zoom level. I have a few questions about this:
asked 07 Feb '12, 23:24 benford |
The export tab is a complex beast that does a number of technologically very different things. For "Mapnik" style raster images, the request is forwarded to code that runs on the tile server, where a Mapnik installation and an up-to-date osm2pgsql-generated OSM database are available to generate custom renderings. This will not export tiles in any way, but render the precise rectangle in the precise resolution chosen. To mimick that, you would have to have the same technology in place. Essentially you could use generate_image.py or nik2img.py to simulate what goes on there; I would also suggest these command line utilities as your "API to allow you to trigger this command programmatically". For raster images in the soon-to-be-removed "Osmarender" style, the backend will indeed use existing tiles and paste them into an image, cropping it to match the requested area. I don't know the exact implementation but it is bound to be something like the scripts featured on the Static map images page on the Wiki. Those scripts are also what you would use if you had your own tile server and wanted to create static "pasted tiles" images of that. answered 08 Feb '12, 10:16 Frederik Ramm ♦ That's just what I was looking for, thanks. Would there be a publicly available source from which I can download the mentioned python scripts?
(08 Mar '12, 16:55)
benford
http://svn.openstreetmap.org/applications/rendering/mapnik/ or http://code.google.com/p/mapnik-utils/wiki/Nik2Img, respectively.
(08 Mar '12, 18:44)
Frederik Ramm ♦
|