Accueil > Docs > Serveurs de tuiles

Serveurs de tuiles

jeudi 3 mai 2012, par b_b

De la théorie sur les systèmes de tuiles :

Mapnik, PostgreSQL

Mapnik, PostgreSQL, Python, Apache mod_tile :

Tuto complet en 6 articles :

Le tuto pointé depuis le wiki osm sur :

This is the method used by, for example, the OSM cycle map. Its main advantage is that nothing needs to run on the webserver - it just needs a directory of image files. So, for example, you can install all the software on your home PC, and transfer the tiles to your webhost when you’re finished.


TileMill :

In regards to TileMill, you export a map as MBTiles and then can either turn it into flat image files with mbutil that you can put on a web server or S3, or you can use TileStream to serve the MBTiles file dynamically.

MapCache is a server that implements tile caching to speed up access to WMS layers. The primary objectives are to be fast and easily deployable, while offering the essential features (and more !) expected from a tile caching solution.

I recently tested a feature of MapCache that can let you publish an MBTiles map build with TileMill but without TileStream Server. So all you have to do is to install Apache module Mapcache from Mapserver web site, add your mbtiles map in your config file and publish your map with OpenLayers. I use this tutorial to install MapCache it from trunk.

Landez :

The flow web app is ok, but a little clunky. It uses the Google Maps API, and with nearly 1000 markers, it loads slowly and interaction is tricky. So I wanted to try a tile-based approach, to improve the speed and visualization, and this seemed like the best opportunity to get into TileMill, part of the MapBox toolset by Development Seed. After going through the tools, I am extremely impressed with what DevSeed is building, and hope I can help out by finding good uses, digging up bugs, and contributing here and there.

So I installed TileMill, updating mapnik in the process. Really nicely designed app, with laser focus on building nice tiles. One of the amazing features is map interactivity, which easily and efficiently turns input data sets into mouseover and infowindow bubbles. The trick it uses is grid renderer, Dane’s extension to mapnik which builds tiled json files, used by the wax library for OpenLayers (and ModestMaps, and GMaps) to define hit areas. Basically, much more efficient than creating markers.

Finally, Dane showed me gridsforkids, a simple sandbox for building image and json tile sets for standalone, offline map apps. I had to grab the “.mml” file created by TileMill, have carto convert that to mapnik xml, and then use the custom to build everything. Found a small bug in how TMS is handled there, and had to hack in a few things for my data set, but it basically works (a few problems with the hit areas, still investigating). One way this could go is streamlining the process, where one of the outputs from TileMill was a tar ball bundling all the tools to run the map offline.

Le site de Michal Migurski, auteur de TileStache :

Utiliser Tilestache avec MySQL :

UTFGrids + OpenLayers + TileStache :

Bloch - Simplify linework in polygonal geographic datasources.

Inspired by Matthew Bloch’s MapShaper thesis (, Bloch can load OGR-compatible data sources and simplify the linework while preserving topology. The simplify() method accepts tolerances in map units, so simplification can be performed by known amounts with predictable outcomes.

Servir les tuiles cachées par TileStache avec nginx :

Les frontières des pays du monde en GeoJSON :

TileLayer.GeoJSON avec leaflet le ticket, une proposition et mon fork pour que ça fonctionne avec tilestache :

Utiliser les layers vector GeoJSON de TileStache avec OpenLayers :

DEM-Tools, Python code for working with Digital Elevation Models and tile rendering :

obtenir des infos sur un shapefile ou un GeoJSON avec gdal

ogrinfo -so -al geodiv.json

Cache de tuiles


Un simple script php pour faire proxy et cacher les tuiles, testé en local c’est pas la joie. Le script renvoie des images "truncated" lors du premier accès aux tuiles (latence lors de l’écriture du cache).

TileCache et Mapproxy semblent simples à installer et fonctionnent avec python. TileStatche est souvent qualifié de successeur de TileCache.

Installer ubuntu server 11.10 en local sous virtualbox

Voici un tuto complet pour l’installation d’Ubuntu Server avec virtualbox bien pratique comme machine de test. La seule chose à corriger est la configuration réseau de la machine virtuelle pour pouvoir y accéder par ssh depuis la machine hôte. Le plus simple est de configurer l’interface réseau de la machine virtuelle sur Accès par pont et de choisir l’interface réseau que vous utilisez sur la machine hôte (wlan0 si vous êtes en wifi ou eth0 si vous êtes en filaire). Un autre article à ce sujet préconise d’utiliser une interface par pont, mais je n’en ai pas eu l’utilité.