From 14d9af03768b0fdbaa60b035f9aad29506801671 Mon Sep 17 00:00:00 2001 From: "RobLabs.com" Date: Thu, 8 Feb 2024 17:34:41 -0800 Subject: [PATCH 1/3] [docs] Update README with result from `mvt -h` --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index fce16d8..dd35520 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,10 @@ OVERVIEW: A utility for inspecting and working with vector tiles. USAGE: mvt +OPTIONS: + --version Show the version. + -h, --help Show help information. + SUBCOMMANDS: dump (default) Print the vector tile as GeoJSON info Print information about the vector tile @@ -37,6 +41,8 @@ SUBCOMMANDS: query Query the features in a vector tile export Export the vector tile as GeoJSON import Import some GeoJSONs to a vector tile + + See 'mvt help ' for detailed help. ``` ## Features From d0ec4837ab9f4317153715c81906d5dec50019ec Mon Sep 17 00:00:00 2001 From: "RobLabs.com" Date: Thu, 8 Feb 2024 17:35:27 -0800 Subject: [PATCH 2/3] add example for `mvt info` --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index dd35520..12df637 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,14 @@ SUBCOMMANDS: See 'mvt help ' for detailed help. ``` +`mvt info` - Print information about the vector tile + +```bash +mvt info Tests/MVTToolsTests/TestData/14_8716_8015.vector.mvt +``` + +--- + ## Features - Load and write Mapnik Vector Tiles from/to disk or data objects (also handles gzipped input) From 1353ad05cfe7350c882b2a9ea957fffdc0316328 Mon Sep 17 00:00:00 2001 From: "RobLabs.com" Date: Fri, 9 Feb 2024 10:28:44 -0800 Subject: [PATCH 3/3] Update README based on feedback from https://github.com/Outdooractive/mvt-tools/pull/15 --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 12df637..dc6f070 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,6 @@ SUBCOMMANDS: See 'mvt help ' for detailed help. ``` -`mvt info` - Print information about the vector tile - -```bash -mvt info Tests/MVTToolsTests/TestData/14_8716_8015.vector.mvt -``` - --- ## Features @@ -110,6 +104,63 @@ let tileData = tile.data() ... ``` +### Playground + +On macOS you can use a Swift Playground to inspect the MVTTools API such as `layerNames` & `projection`. + +* Load tile using MVTTools +* Inspect the properties of the `VectorTile` + +### `mvt dump` + +Print the vector tile as GeoJSON. + +`mvt` works with a vector tile from local disk. + +Example 1: Print information about the MVTTools test vector tile at zoom 14, at Yaoundé, Cameroon. + +```bash +mvt dump Tests/MVTToolsTests/TestData/14_8716_8015.vector.mvt +``` + +### `mvt info` + +```bash +mvt info Tests/MVTToolsTests/TestData/14_8716_8015.vector.mvt +``` + +*Result* + + Name | Features | Points | LineStrings | Polygons | Unknown | Version + --------------------+----------+--------+-------------+----------+---------+-------- + area_label | 55 | 55 | 0 | 0 | 0 | 2 + barrier_line | 4219 | 0 | 4219 | 0 | 0 | 2 + bridge | 14 | 0 | 14 | 0 | 0 | 2 + building | 5414 | 0 | 0 | 5414 | 0 | 2 + building_label | 413 | 413 | 0 | 0 | 0 | 2 + ... + road | 502 | 1 | 497 | 4 | 0 | 2 + road_label | 309 | 0 | 309 | 0 | 0 | 2 + +--- + +`mvt` works with a vector tile served from a web server. + +Example 2: Inspect a MapLibre vector tile at zoom 2, with an extent showing Norway to India. + +```bash +mvt info https://demotiles.maplibre.org/tiles/2/2/1.pbf +``` + +*Result* + + Name | Features | Points | LineStrings | Polygons | Unknown | Version + ----------+----------+--------+-------------+----------+---------+-------- + centroids | 104 | 104 | 0 | 0 | 0 | 2 + countries | 113 | 0 | 0 | 113 | 0 | 2 + geolines | 4 | 0 | 4 | 0 | 0 | 2 + + ## Contributing Please create an issue or open a pull request with a fix