Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme with current CLI help results #15

Merged
merged 3 commits into from
Feb 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,23 @@ OVERVIEW: A utility for inspecting and working with vector tiles.

USAGE: mvt <subcommand>

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
merge Merge two or more vector tiles
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 <subcommand>' for detailed help.
```

---

## Features

- Load and write Mapnik Vector Tiles from/to disk or data objects (also handles gzipped input)
Expand Down Expand Up @@ -96,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
Expand Down
Loading