You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generates contour tiles in Mapbox Vector Tile (MVT) format from terrain raster-dem data using [maplibre-contour](https://github.com/onthegomap/maplibre-contour). It allows `maplibre-contour` to work with PMTiles (local or HTTP) when the `demUrl` is prefixed with `pmtiles://` and outputs to local MVT tiles.
4
-
5
-
This script outputs tile files in the `<outputDir>/z/x/y.pbf` format and generates a `<outputDir>/metadata.json` file. These files can be imported using [mbutil](https://github.com/mapbox/mbutil). For example, to import the tiles into an mbtiles file using mbutil, the syntax would be: `mb-util --image_format=pbf <outputDir> output.mbtiles`.
3
+
This tool generates contour lines from terrain raster-dem and outputs them as Mapbox Vector Tiles (MVT). It uses [maplibre-contour](https://github.com/onthegomap/maplibre-contour) and supports various raster-dem sources, including PMTiles (local or HTTP), MBTiles (local) when the `demUrl` is prefixed accordingly. The output is a set of MVT tiles in a standard `z/x/y.pbf` directory structure, along with a `metadata.json` file. These tiles can be easily imported into an MBTiles file using tools like `mbutil` (e.g., `mb-util --image_format=pbf <outputDir> output.mbtiles`).
4
+
5
+
# Installation and Usage
6
+
7
+
You can install and use `contour-generator` in several ways:
8
+
9
+
***Globally via npm:** This is the most convenient way to use the command-line interface directly.
10
+
```bash
11
+
npm install -g contour-generator
12
+
```
13
+
Once installed globally, you can execute the command as:
14
+
```bash
15
+
contour-generator <function> [options]
16
+
```
17
+
18
+
***Locally from source:** If you have cloned the repository or downloaded the source.
*`--demUrl <string>`: The URL of the DEM source (e.g., `pmtiles://<http or local file path>` or a tile URL pattern like `https://<zxyPattern>`).
46
+
*`--demUrl <string>`: The URL of the DEM source (e.g., `pmtiles://<http or local file path>`, `mbtiles://<local file path>`, or a tile URL pattern like `https://<zxyPattern>`).
24
47
*`--encoding <string>`: The encoding of the source DEM tiles (e.g., `'terrarium'`, `'mapbox'`). (default: `mapbox`)
25
48
*`--sourceMaxZoom <number>`: The maximum zoom level of the source DEM. (default: `8`)
26
49
*`--increment <number>`: The contour increment value to extract. Use `0`for default thresholds.
The -v ```$(pwd):/data``` part of the docker run command maps your local working directory ```$(pwd)``` to ```/data``` inside the Docker container. Therefore, your DEM file must be located in the ```/data``` directory inside of the docker image, and the output directory must also be in the ```/data``` directory.
The -v ```$(pwd):/data``` part of the docker run command maps your local working directory ```$(pwd)``` to ```/data``` inside the Docker container. Therefore, your DEM file must be located in the ```/data``` directory inside of the docker image, and the output directory must also be in the ```/data``` directory.
0 commit comments