UavPy¶

UavPy is a Python package for processing and analyzing UAV imagery. It provides a small, high-level API for loading orthomosaics, stacking raster bands, computing spectral indices, extracting plot-level regions of interest, and visualizing geospatial raster data.
The package builds on GDAL, rasterio, Fiona, NumPy, SciPy, and scikit-image.
What You Can Do¶
- Load a GeoTIFF orthomosaic into an
Orthomosaicartifact. - Stack multiple single-band rasters into one multi-band raster.
- Compute NDVI, NDRE, EVI, SAVI, WDVI, and custom band-math expressions.
- Extract one georeferenced orthomosaic per polygon feature from a vector file.
- Save processed rasters as GeoTIFFs for map display.
- Display raster tile layers and vector layers with
mapwidgets.MapViewer.
See Runnable Examples for focused scripts that cover loading, plot extraction, spectral indices, and interactive maps.
Requirements¶
UavPy requires Python 3.10 or newer.
GDAL is a native dependency. The Python GDAL package must match the native GDAL library available on the machine. This checkout currently pins:
1 | |
On macOS with Homebrew GDAL, make sure gdal-config is on PATH before installing:
1 | |
GDAL version matching
If uv sync fails with a message like Python bindings of GDAL ... require at least libgdal ..., update the Python gdal dependency to match the version reported by gdal-config --version, or update the native GDAL installation to match the pinned Python package.
Install For Development¶
1 | |
Run tests:
1 | |
Serve the docs locally:
1 | |
Build the static docs:
1 | |
Install the optional map viewer dependencies when using mapwidgets.MapViewer:
1 | |
Quick Start¶
Load a single orthomosaic:
1 2 3 4 5 | |
Stack single-band rasters:
1 2 3 4 5 6 7 8 9 | |
Compute NDVI:
1 2 3 4 5 | |
Compute a custom index:
1 2 3 | |
Create map tiles with mapwidgets and add them to an interactive map:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Extract plot-level rasters:
1 2 3 4 5 6 7 | |
Project Layout¶
uavpy/artifacts- Raster and vector artifact classes such asOrthomosaic,DSM,DTM, andShapeFile.uavpy/tools- Spectral index and expression parsing tools.uavpy/util- Raster, array, math, GDAL, rasterio, and visualization utilities.uavpy/decor- Internal decorator helpers.tests- Test suite.mkdocs- Documentation source.docs- Built static documentation output.
Useful Commands¶
uv sync- Install the project and development dependencies.uv run pytest- Run the test suite.uv run mkdocs serve- Start the live-reloading docs server.uv run mkdocs build- Build the static documentation site.
Citation¶
1 2 3 4 5 6 7 | |