Skip to content

hgstrf/dem-clip

Repository files navigation

dem-clip

A lightweight and straightforward tool to clip Digital Elevation Models (DEMs) using a shapefile or GeoJSON polygon.

Features

  • Clip elevation GeoTIFFs using an AOI polygon
  • Outputs clipped raster with retained metadata

Installation

  1. Clone the repo or download the files:
git clone https://github.com/yourusername/dem-clip.git
cd dem-clip
  1. Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install the dependencies:
pip install -r requirements.txt

Usage

Make sure you have:

  • A .tif DEM file (e.g., input.tif)
  • A .geojson or .shp file for the area of interest (AOI)

Then run:

python clip_dem.py --input examples/input.tif --aoi examples/aoi.geojson --output clipped.tif

Folder Structure

dem-clip/
├── clip_dem.py
├── requirements.txt
├── README.md
├── LICENSE
└── examples/
    ├── input.tif      # Your DEM file
    └── aoi.geojson    # Your AOI file

License

MIT License

About

Clip Digital Elevation Models (DEMs) using a shapefile or GeoJSON polygon, Python only.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages