Git Product home page Git Product logo

rivermapper's Introduction

River Mapper

Python script to transform a Digital Elevation Model (DEM) image into a map of rivers. You need Python 3 with numpy and imageio.

Script execution: rivermapper.py input_image.tif output_image.tif [-l sea_level] [-s random_seed] [-c contrast] [-d output_bit_depth] or: rivermapper.py -i input_image.tif -o output_image.tif [-l sea_level] [-s random_seed] [-c contrast] [-d output_bit_depth]

Used RAM: around 10 Mo per milion pixels (400 Mo for a 6001x6001 SRTM image) Time taken: it can take several minutes. The same SRTM image takes arount 20 minutes. Please be patient.

It should support most of image types (PNG, TIFF, JPG, BMP, ...) and bit depths (8, 16, 32, 64).

Behaviour:

  • It creates river systems from start points (pixels near the sea, or on the edge of the map), by analysing the slope to find in which direction the water will flow, on every pixel. Rivers are the points that receive the water from numerous pixels (usually some thousands, or even millions).
  • It supports basins. There are generally not naturals, but still exist in most of the DEM, because of approximative data. It find the simplest way to get the river escape the basin.
  • It can't determine rivers positions on too flat areas, because we need some slope to know where the water flows. In this case, rivers are set randomly.
  • We obviously can't know how much water comes from outside of the map. So, the rivers that are on the edge of the map may have a smaller value than in the reality. There is not this problem for an island.

An example with the Corsica island:

The original image in zip file: corsica.zip

Enhanced DEM to show the mountains and the valleys: corsica_enhanced Rivers map built with RiverMapper: corsica_rivers

rivermapper's People

Contributors

gaelysam 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.