[GIS] Does tile server renders every request

mapnikopenstreetmaprenderingtiles

I am trying to understand how tile server handle requests.

I red about Mapnik which "creates" the map using OSM,

Does "creates" means that every request is rendered and returned? If yes what is the performance hit (global map)?

Or it means that Mapnik Creates all tiles needed on initialization and then serves the right one upon request? if yes what is the total storage needed for all tiles(for global map)?

I am trying to find a way to build my own tile server (global map) while rendering it only once.

Best Answer

Mapnik itself is basically just a rendering engine. As I understand, it can be used to render anything from tiles, to 8.5"x11", and even plotter-sized PDFs. To describe it very simply, Mapnik takes your data inputs, a spatial boundary, and a set of symbology styles (either hard-coded or an XML source), then it renders the map (potentially just a simple tile) relative to your inputs.

In other words, Mapnik isn't a server. However, your service layer--web methods or scripts in the context of your server's web scope--can certainly make calls against Mapnik to render tiles one-by-one. There's a whole program called mod_tile for doing that on the fly.

But as for every request--be aware of caching. If you want to defeat caching, you can typically send a time stamp uint as a url variable so that each request is considered unique by your web server.

My immediate advice is just install Mapnik on your development system (if Windows) and check out the demo (demos/rundemo.py also, generate_tiles.py). Boston GIS has some decent tutorials. Hack these a little bit and you'll learn a lot about how Mapnik consumes style definitions and renders something---be it a tile or otherwise.