Fork 0
mirror of https://github.com/sbrl/terrain50-cli.git synced 2024-07-18 12:48:38 +00:00
Backup mirror of the terrain50-cli on npm https://github.com/sbrl/terrain50-cli
Go to file
2022-12-06 18:03:18 +00:00
src json: Fix crash when --output is specified 2022-12-06 18:01:00 +00:00
.gitignore .gitignore: ignore all .asc files 2022-12-06 16:42:39 +00:00
Changelog.md tweak changelog 2022-12-06 18:01:21 +00:00
LICENSE Initial commit - create skeleton repo to migrate code into 2020-03-27 18:55:35 +00:00
package-lock.json 1.10.1 2022-12-06 18:03:18 +00:00
package.json 1.10.1 2022-12-06 18:03:18 +00:00
README.md README: add todo 2022-12-06 16:58:54 +00:00


CLI for parsing Ordnance Survey Digital Elevation Model files

This is the CLI for the sister terrain50 library on npm for parsing Ordnance Survey DEM files in the ASCII Esri Grid format I also implemented.


Install via npm:

npm install terrain50-cli --global


The command-line interface works on a subcommand-based system using applause-cli (another package of mine).

Display the usage information like this:

terrain50 --help

If you installed it locally, you'll need to do this:

path/to/node_modules/.bin/terrain50 --help

Environment Variables

Additionally, a number of environment variables are supported.

Variable Purpose
NO_COLOR Disables ANSI escape codes in output (i.e. coloured output). Not recommended unless you have a reason.
QUIET Suppress all output except for warnings and errors (not fully supported everywhere yet)


image subcommand: --boundaries argument

This argument's purpose is the divide the incoming data into categories so that an AI can be potentially trained on the data (e.g. water depth data, as I'm using). It takes a comma separated list of values like this:


...and turns it into a number of bins like so:

  • -Infinity ≤ value < 0.1
  • 0.1 ≤ value < 0.5
  • 0.5 ≤ value < 1
  • 1 ≤ value < 5
  • 5 ≤ value < Infinity

Each bin is assigned a colour. Then, for each value in the input, it draws the colour that's assigned to the bin that the value fits into.

Read-world use

  • I'm using it for for my PhD in Computer Science!
  • (Are you using this project? Get in touch by opening an issue)


Contributions are welcome as PRs! Don't forget to say that you donate your contribution under the Mozilla Public License 2.0 in your PR comment.

TODO: Use gunzip-maybe to transparently support reading from gzipped .gz input files


This project is licensed under the Mozilla Public License 2.0. See the LICENSE file in this repository for the full text.