From OpenStreetMap Wiki
Jump to: navigation, search

Metatile File Structure

The metatile file structure from mod_tile/render has been used:

 struct entry {
   int offset;
   int size;

 struct meta_layout {
   char magic[4];        // 'M' 'E' 'T' 'A'
   int count;            // METATILE ^ 2
   int x, y, z;          // lowest x,y of this metatile, plus z
   struct entry index[]; // count entries
   // Followed by the tile data
   // The index offsets are measured from the start of the file

See backend-mapnik/metatilehandler.h|.cc for the code.

Metatile Directory Structure

Typically all tiles are stored in /var/lib/tirex/tiles/MAP/ with MAP being the map (map style) name. But you can choose a different directory in the map config file. (Currently not all parts of the Tirex system can understand tiles stored in different parts of the filesystem so you should stick with this one directory for the time being.)

The metatile directory structure from mod_tile/render has been used:


The first component is the zoom level (starting at 0).

The next four directory components and the filename depend on the X and Y metatile coordinates. The scheme makes sure that there aren’t too many files inside a single directory.

See Tirex::Metatile for conversion methods.