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 mismatchesdissolve_by_attribute(vector_gdf, attribute, agg_func="first")— dissolve polygons by shared attributeclip_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
Visualization
plot_raster(raster_path, title, cmap)— quick raster previewplot_vector(vector_gdf, column, title)— quick vector/choropleth previewplot_zonal_result(vector_gdf, column, title)— convenience wrapper for zonal stats results
Format conversion
convert_vector_format(input_path, output_path)— convert between Shapefile, GeoJSON, GPKG, KMLload_kmz(path)— load a KMZ (zipped KML) fileload_vector(path, target_crs, fix_invalid)— load with automatic geometry repairload_raster_as_array(path)— load raster as numpy array + metadata
Terrain analysis
compute_slope(dem_array, pixel_size, units)— slope in degrees/percent/radianscompute_aspect(dem_array, pixel_size)— compass direction of slope (0-360°)compute_hillshade(dem_array, pixel_size, azimuth, altitude)— simulated illumination
Spatial analysis
distance_to_nearest(source_gdf, target_gdf, distance_col_name)— distance from each feature to nearest target feature
Raster transformation
reproject_raster(input_path, output_path, target_crs, resampling_method)— reproject to a new CRSresample_raster(input_path, output_path, target_resolution)— change pixel resolution
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geofeatures-0.5.0.tar.gz.
File metadata
- Download URL: geofeatures-0.5.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b213e5ddec8ffe78aee87365e36e5b1d67883e55e4f906f46fe2466617e05dd2
|
|
| MD5 |
fad5be515e13067b36e5c3237a9965cf
|
|
| BLAKE2b-256 |
af3f07126e20f08a27588430b484efcfe235d5a41c21fb45d59aa0b910f11438
|
File details
Details for the file geofeatures-0.5.0-py3-none-any.whl.
File metadata
- Download URL: geofeatures-0.5.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b354f1ada0031903e3a125e62c526dee5e28165dbb81fb3c2a682c022783283
|
|
| MD5 |
9564409aea330399ebcc6e6946538f92
|
|
| BLAKE2b-256 |
304be4638dbc58095eaaa55e19e91772e791569300f579c23c8a481ee5743d72
|