Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use Vector tiles slicing tool in GIS development

Shulou Source: shulou.com Published: 2022-06-01 06:57:10 09月30日 Update

This article shows you how to use the Vector tiles slicing tool in GIS development, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

As a slice layer that can be styled on the client side, vector tiles can be published by various software, such as Portal for ArcGIS, geoserver, MapServer and so on. The client loads through mapbox gl and sets the style of the layer. Of course, mapbox officials also provide open source slicing tools to slice vector data, which is similar to the slicing of an image map. It is recommended to use tippecanoe for slicing. The open source address is https://github.com/mapbox/tippecanoe.

This tool is written by C++, can be compiled and run directly on macos and linux, the windows version does not seem to be provided, need to be compiled by cmake, so try to find a linux or macos machine to use.

Tools are used on the command line, for example:

Tippecanoe-zg-o out.mbtiles-- drop-densest-as-needed in.geojson

The above command is to slice the geojson data into a mbtile slice package, where-zg is sliced to the maximum map zoom level, and-o out.mbtiles is the file path of the output mbitles, which can also be stored as a folder, using-e / tilepath, which can only be cut into one format at a time.

-- drop-densest-as-needed is to reduce file size, improve data loading efficiency, and simplify data. Finally, in.geojson is an imported geojson file, which can load multiple json files, cut together, and can access a layer separately when accessing.

The sliced data format is .pbf, and some released mvt formats are also available.

Other parameters-Z11-Z4 indicate that the slice is cut from 4 to 11.

There are also parameters such as filtering and zooming. See the information on github.

There are two points to note:

The data should be encoded in utf-8 format before slicing, otherwise there will be garbled code.

The column direction number of the slice in the folder and mbtiles is different because the origin of the y direction is different, which should be paid attention to when publishing the data.

The slices of the folder can be published with the web server, and mbtiles needs a simple server to read the data and return it.

The above is how to use the Vector tiles slicing tool in GIS development. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Data files tools formats folders development content parameters commands maps clients clients skills directions time styles knowledge cutting compilation simplicity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MySQL Apple Microsoft Shulou Information