SASGIS

Веб-картография и навигация


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002995SAS.Планета[All Projects] Хотелкаpublic22-03-2016 20:1423-03-2016 14:05
Reporterzed 
Assigned Tozed 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version151111 
Target Version160606Fixed in Version160606 
Summary0002995: Экспорт в MBTiles с генерированием TileMill совместимой схемы
DescriptionTileMill создаёт следующие таблицы:


CREATE TABLE grid_key (
    grid_id TEXT,
    key_name TEXT
);
CREATE UNIQUE INDEX grid_key_lookup ON grid_key (grid_id, key_name);

CREATE TABLE grid_utfgrid (
    grid_id TEXT,
    grid_utfgrid BLOB
);
CREATE UNIQUE INDEX grid_utfgrid_lookup ON grid_utfgrid (grid_id);

CREATE TABLE images (
    tile_data blob,
    tile_id text
);
CREATE UNIQUE INDEX images_id ON images (tile_id);

CREATE TABLE keymap (
    key_name TEXT,
    key_json TEXT
);
CREATE UNIQUE INDEX keymap_lookup ON keymap (key_name);

CREATE TABLE map (
   zoom_level INTEGER,
   tile_column INTEGER,
   tile_row INTEGER,
   tile_id TEXT,
   grid_id TEXT
);
CREATE UNIQUE INDEX map_index ON map (zoom_level, tile_column, tile_row);

CREATE TABLE metadata (
    name text,
    value text
);
CREATE UNIQUE INDEX name ON metadata (name);

А для того, чтобы это всё походило на MBTiles формат, создаются 3 вьюхи:

CREATE VIEW grid_data AS
    SELECT
        map.zoom_level AS zoom_level,
        map.tile_column AS tile_column,
        map.tile_row AS tile_row,
        keymap.key_name AS key_name,
        keymap.key_json AS key_json
    FROM map
    JOIN grid_key ON map.grid_id = grid_key.grid_id
    JOIN keymap ON grid_key.key_name = keymap.key_name;

CREATE VIEW grids AS
    SELECT
        map.zoom_level AS zoom_level,
        map.tile_column AS tile_column,
        map.tile_row AS tile_row,
        grid_utfgrid.grid_utfgrid AS grid
    FROM map
    JOIN grid_utfgrid ON grid_utfgrid.grid_id = map.grid_id;

CREATE VIEW tiles AS
    SELECT
        map.zoom_level AS zoom_level,
        map.tile_column AS tile_column,
        map.tile_row AS tile_row,
        images.tile_data AS tile_data
    FROM map
    JOIN images ON images.tile_id = map.tile_id;

Тайлы сохраняются в таблицу images, а в качестве id используется md5 хэш от тела тайла. Координаты тайлов (X, Y, Z) сохраняются в таблицу map. Таблица metadata содержит поля: bounds, minzoom, maxzoom, attribution, description, name, template (пустое), version '1.0.0'. Остальные таблицы пустые.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Users who viewed this issue
User List Anonymous (1986x), zed (7x), vdemidov (2x)
Total Views 1995
Last View 21-11-2024 17:44

- Issue History
Date Modified Username Field Change
22-03-2016 20:14 zed New Issue
22-03-2016 20:14 zed Status new => assigned
22-03-2016 20:14 zed Assigned To => zed
22-03-2016 20:24 zed Summary Экспорт в MBTiles с генерированием TileMill совместимой схемой => Экспорт в MBTiles с генерированием TileMill совместимой схемы
23-03-2016 14:05 zed Status assigned => resolved
23-03-2016 14:05 zed Fixed in Version => 160606
23-03-2016 14:05 zed Resolution open => fixed



Copyright © 2007 - 2024 SAS.Planet Team