Skip to content

A small collection of scripts to compute raster and polygon masks for a user-defined region.

License

Notifications You must be signed in to change notification settings

eciraci/create_basin_mask

Repository files navigation

Create Basin Binary Mask

Language License

This repository contains small collection of scripts that can be used to:

  1. Compute the binary mask of a basin from its boundaries provided as an esri shapefile.
  2. Extract the boundaries of a basin from its raster binary mask.

Installation:

  1. Setup minimal conda installation using Miniconda

  2. Create Python Virtual Environment

    • Creating an environment with commands (Link);
    • Creating an environment from an environment.yml file (Link);

Examples:

  1. Conversion from shapefile boundaries to raster binary mask:

    python convert_shp_to_raster.py './data/input/Indus.dir/Indus.shp'  --res=0.5
    

data/output/shapefile_to_raster/Indus/Indus.jpeg

  1. Conversion from raster binary mask to shapefile boundaries:

    python convert_raster_to_shp.py './data/output/shapefile_to_raster/Indus/Indus.tiff'

data/output/raster_to_shapefile/Indus/Indus.jpeg

PYTHON DEPENDENCIES:

License

The content of this project is licensed under the Creative Commons Attribution 4.0 Attribution license and the source code is licensed under the MIT license.

About

A small collection of scripts to compute raster and polygon masks for a user-defined region.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published