Tiles@home/Dev/Website/Database

From OpenStreetMap Wiki
Jump to navigation Jump to search

tiles_meta

This will be the tiles database, where the tiles are stored on the filesystem. Structure and design still open to comment until 2007-02-29.

CREATE TABLE `tiles_meta` (
  `x` int(10) unsigned NOT NULL,
  `y` int(10) unsigned NOT NULL,
  `z` tinyint(11) unsigned NOT NULL COMMENT 'zoom 0-17',
  `type` tinyint(11) unsigned NOT NULL COMMENT 'which tileset',
  `size` int(11) unsigned NOT NULL COMMENT 'bytes',
  `date` datetime NOT NULL COMMENT 'Upload date',
  `user` smallint(11) NOT NULL COMMENT 'Uploader',
  `version` smallint(5) unsigned NOT NULL COMMENT 'software used to create',
  `spare1` int(11) NOT NULL,
  `spare2` int(11) NOT NULL,
  PRIMARY KEY  (`x`,`y`,`z`,`type`),
  KEY `size` (`size`),
  KEY `type` (`type`),
  KEY `version` (`version`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Discussion

  • Type - to allow storing more than one layer of tiles
  • Size - integer lets us count up to 2GB
  • Spare - in case we want to mark things (to import, to export, etc.) without changing the structure
  • Users as integer - just to save space.
  • Version - will need to interpret tiles@home version name into an integer and store that. Allows re-rendering of tiles when version number changes
  • Index on size - to help find blank tiles