Giter Club home page Giter Club logo

terrain-rgb-generator's Introduction

Terrain RGB generator

Tool that allows to easily deploy an environment able to work with geotiff files containing Digital Elevation Model (DEM) data. It is focused on the generation of raster MBTiles pyramids, containing a Mapbox Terrain-RGB tileset with the elevation data encoded in Terrain-RGB tiles. Those tiles can be used to represent the topographic surface of the Earth.

Usage

Set up

First of all, there are some environment variables that need to be established in the .env file, which are the following:

MIN_ZOOM           # min zoom to generate
MAX_ZOOM           # max zoom to generate
INPUT_FILE         # name of the input raster file
OUTPUT_FILE        # name of the output mbtiles file
WORKERS            # workers to run [DEFAULT=4]

Also, you can ask for a help message if you need

make help

Build

To work with this tool you need Docker.

  • Install Docker. Minimum version is 1.12.3+.

The docker image is based on osgeo/gdal. For the raster data management, rasterio and a few plugins from the RasterIO Plugin Registry, such as rio-mbtiles and a custom and powered version of rio-rgbify, are installed.

Then, you can build the container from the dockerfile

make build-docker

Or simply run it using the image from the Docker Hub as follows.

Generate pyramid

By default, it is generated in the data directory.

make generate-pyramid-rgb

Custom

You can run a bash shell inside the docker container if you want to run some more detailed commands

make bash

Considerations

If you are wondering the resolution per zoom, check the following table.

Arc resolution per zoom and data sources, per pixel:

zoom meters at equator arc seconds nominal arc degrees minutes seconds nominal ground units
0 156543.0 5071.0 1.5 arc degrees
1 78271.5 2535.5 40 arc minutes
2 39135.8 1267.8 20 arc minutes
3 19567.9 633.9 10 arc minutes
4 9783.9 316.9 5 arc minutes
5 4892.0 158.5 2.5 arc minutes
6 2446.0 79.2 1 arc minutes 2.5 km
7 1223.0 39.6 30 arc seconds 1km
8 611.5 19.8 15 arc seconds 500m
9 305.7 9.9 7.5 arc seconds 250m
10 152.9 5.0 5 arc seconds
11 76.4 2.5 3 arc seconds 90m
12 38.2 1.2 1 arc seconds 30m
13 19.1 0.6 2/3 arc seconds
14 9.6 0.3 1/3 arc seconds 10m
15 4.8 0.2 1/5 arc seconds
16 2.4 0.1 1/9 arc seconds 3m

Credits: Mapzen documentation.

Author

Fran Martín

License

This project is licensed under the MIT License - see the LICENSE file for details.

terrain-rgb-generator's People

Contributors

fmariv avatar

Stargazers

Brian Sherman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.