切指定级别
低级别会被简化
OGR_GEOJSON_MAX_OBJ_SIZE=10240MB ogr2ogr -f MVT output_dir input.geojson -dsco MAXZOOM=5 -dsco MINZOOM=0 -dsco TILING_SCHEME="EPSG:4326,-180,90,180" -dsco FORMAT=DIRECTORY
根据配置文件切
ogr2ogr -f MVT output_dir input.gpkg -dsco TILING_SCHEME="EPSG:4326,-180,90,180" -dsco FORMAT=DIRECTORY -dsco CONF=conf.json
配置文件示例:设置每个图层级别、pbf中图层名
{
"boundaries_lod0": {
"target_name": "boundaries",
"description": "Country boundaries",
"minzoom": 0,
"maxzoom": 2
},
"boundaries_lod1": {
"target_name": "boundaries",
"minzoom": 3,
"maxzoom": 5
}
}
官网:
https://gdal.org/drivers/vector/mvt.html#dataset-creation-options
参考:
https://gis.stackexchange.com/questions/336416/generate-epsg4326-vector-tiles