Mapbox vector datasets: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
(Created page with "''From version 4.3'' Maria Map Maker supports the Mapbox vector tiles format, as well as a subset of the Mapbox JSON style specification. This article explains the process of...")
 
No edit summary
Line 1: Line 1:
''From version 4.3''
''From version 4.3''
Maria Map Maker supports the Mapbox vector tiles format, as well as a subset of the Mapbox JSON style specification. This article explains the process of importing and styling vector data with these formats.
 
Maria Map Maker supports the [https://github.com/mapbox/vector-tile-spec Mapbox vector tiles format], as well as a subset of the Mapbox JSON style specification. This article explains the process of importing and styling vector data with these formats.


== Import ==
== Import ==
=== Format ===
=== Format ===
When Maria Map Maker imports vector data, it is translated to [Mapbox vector tiles]. This is a very high-performant format, but the translation process requires some tuning and know-how to get the desired result.
[[File:zoomlevels.jpeg|right|border]]
When Maria Map Maker imports vector data, it is translated to Mapbox vector tiles (.mbtiles). This is a very high-performant format, but the translation process requires some tuning and know-how to get the desired result.


The MBTiles format splits the vector data into tiles and zoom levels. Each tile contains 4096 x 4096 nodes, which are roughly equivalent to a pixel in a raster image. When vector data is converted to MBTiles, all vertices are snapped to the nearest node in a tile, losing some precision in the process.  
The MBTiles format splits the vector data into tiles and zoom levels. Each tile contains 4096 x 4096 nodes, which are roughly equivalent to a pixel in a raster image. When vector data is converted to MBTiles, all vertices are snapped to the nearest node in a tile, losing some precision in the process.  

Revision as of 10:35, 5 July 2022

From version 4.3

Maria Map Maker supports the Mapbox vector tiles format, as well as a subset of the Mapbox JSON style specification. This article explains the process of importing and styling vector data with these formats.

Import

Format

Zoomlevels.jpeg

When Maria Map Maker imports vector data, it is translated to Mapbox vector tiles (.mbtiles). This is a very high-performant format, but the translation process requires some tuning and know-how to get the desired result.

The MBTiles format splits the vector data into tiles and zoom levels. Each tile contains 4096 x 4096 nodes, which are roughly equivalent to a pixel in a raster image. When vector data is converted to MBTiles, all vertices are snapped to the nearest node in a tile, losing some precision in the process.

Each tile belongs to a zoom level. Zoom level 0 is a single tile which covers the entire Earth (in Web Mercator projection). With every increasing zoom level, each tile is divided into four. As an example, zoom level 15 roughly equals map scale 1:15 000 at the equator. At this level, the entire Earth consists of around one billion tiles.

When importing vector data to MBTiles, you need to decide which zoom levels (z) to create. This zoom extent is not possible to change later. The vector data simply does not exist on the levels outside the zoom extent you choose. This means that you have to be familiar with your source data and how they are going to be used. Using zoom levels which are not appropriate for the source data can have some negative effects:

Using too low zoom level - too much data is stored in each tile, which would lead to poor performance. To prevent this, after a tile reaches a threshold of 500 KB or 200 000 features, additional features destined for that tile will either be simplified or dropped. Using too high zoom level - large, simple features are split across an exaggerated number of small tiles, which leads to unnecessary large files and long processing time.

Import dialog

The vector data import dialog lists all the layers in the source dataset, with a zoom selector for each. The checkboxes controls wether or not the layer is included in the resulting MBTiles dataset. You can use the top "All layers" control to set a common data range.

You can choose the style format for the output dataset - , or the Mapbox JSON format described in this article, or the legacy MARIA GDK XML format. The MARIA GDK style will be phased out starting with MARIA GDK version 4.3.