Skip to main content

Zonal statistics and NDVI feature extraction for remote sensing ML pipelines

Project description

GeoFeatures

Python library for spectral index computation, zonal statistics, and vector/raster operations for remote sensing ML pipelines.

Install

pip install geofeatures

Spectral indices

Function Detects Inputs
compute_ndvi() Vegetation health NIR, Red
compute_evi() Dense vegetation NIR, Red, Blue
compute_savi() Sparse vegetation NIR, Red
compute_gndvi() Chlorophyll NIR, Green
compute_ndwi() Surface water Green, NIR
compute_mndwi() Urban water Green, SWIR
compute_ndmi() Vegetation moisture NIR, SWIR
compute_ndbi() Built-up areas SWIR, NIR
compute_bsi() Bare soil SWIR, Red, NIR, Blue
compute_nbr() Burn severity NIR, SWIR2

Zonal statistics

  • extract_zonal_features(raster_path, vector_gdf, stats)
  • ndvi_zonal_stats(...) — convenience wrapper (NDVI + zonal stats in one call)

Vector operations

  • merge_shapefiles(gdf_list, target_crs=None) — merge GeoDataFrames, handling CRS mismatches
  • dissolve_by_attribute(vector_gdf, attribute, agg_func="first") — dissolve polygons by shared attribute
  • clip_vector(vector_gdf, clip_boundary_gdf) — clip vector to a boundary

Raster-vector operations

  • clip_raster_by_vector(raster_path, vector_gdf, output_path) — clip a raster to a vector boundary

Validated

Tested end-to-end on real Sentinel-2 L2A imagery over Ogun State, Nigeria. 18 unit tests with hand-verified formula outputs and edge-case coverage (CRS mismatches, missing columns, spatial overlap logic).

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.3.0.tar.gz (6.7 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.3.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for geofeatures-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0a66f91fa47ffae94d3e3ffd9a11e974769b2f6701d29884eb457c195499d8b1
MD5 394baff40d90e5388809a0acd851055f
BLAKE2b-256 917e558d23f80d058b7255abaa0cf95aadc37a0e6d8fc8a29cb832ab875146de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: geofeatures-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc83ef99dbde312d2d7cacc57ffc29f8f0a987e23f346d3faae3b5575a176410
MD5 dfbd02d7b84b73c50abef1c05422f5cf
BLAKE2b-256 05fda6c6ecb24c8b815c0eac6aca9ccdef5b59a3997403efc71918cc9a43133b

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