Skip to main content

Zonal statistics and NDVI feature extraction for remote sensing ML pipelines

Project description

GeoFeatures

Lightweight Python library for extracting zonal statistics and vegetation indices (NDVI) from satellite imagery for remote sensing ML pipelines.

Why

Computing per-polygon raster statistics (e.g. mean NDVI per farm parcel or administrative region) is a repetitive step in almost every remote sensing / geospatial ML workflow. GeoFeatures wraps this into a clean, tested API.

Install

pip install geofeatures

Quick example

from geofeatures.core import ndvi_zonal_stats
import geopandas as gpd

polygons = gpd.read_file("parcels.geojson")

result = ndvi_zonal_stats(
    nir_band=nir,
    red_band=red,
    vector_gdf=polygons,
    raster_template_path="ndvi.tif"
)

print(result[["name", "mean", "std"]])

Validated on real data

Tested end-to-end on Sentinel-2 L2A imagery (via Microsoft Planetary Computer) over Ogun State, Nigeria — mean NDVI of 0.29 across ~4M pixels, consistent with mixed agricultural/urban land cover.

API

  • compute_ndvi(nir_band, red_band) — compute NDVI from raw bands
  • extract_zonal_features(raster_path, vector_gdf, stats) — zonal statistics per polygon
  • ndvi_zonal_stats(nir_band, red_band, vector_gdf, raster_template_path) — convenience wrapper combining both

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geofeatures-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geofeatures-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file geofeatures-0.1.0.tar.gz.

File metadata

  • Download URL: geofeatures-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for geofeatures-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7bb688f529ef2184bb532098f9ff5d2241e6a8fe228a25e0bc4560c9131b1040
MD5 530bee3f4253b5d2af12229e5a43ea3f
BLAKE2b-256 a6894571ad596a7f0c43f349bf99556046deee74e517ba18f4db389d254e1404

See more details on using hashes here.

File details

Details for the file geofeatures-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: geofeatures-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for geofeatures-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 170371abe2d17beba2aacd9c0c5ad44f4dfcb5d4788d66e9cdccb30aa452fda4
MD5 81384bce9f74a463b0d637695076c628
BLAKE2b-256 39f8ce541306040bc1d60d3d05f0ea676ae19ba7537dc6197f522639d57f5aca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page