Agricultural geospatial analysis toolkit
Project description
AgriScope-V0.1.1
Agricultural geospatial analysis toolkit extending GeoPandas.
Installation
pip install AgriScope
# With performance extras (Dask chunking support)
pip install "AgriScope[performance]"
Quickstart
import geopandas as gpd
import AgriScope # registers the .agri accessor
gdf = gpd.read_file("fields.geojson")
# NDVI
gdf = gdf.agri.compute_ndvi("red", "nir")
# Soil management zones
gdf = gdf.agri.soil_zones(n_clusters=4)
# Irrigation needs
gdf = gdf.agri.irrigation_needs(evapotranspiration=5.2, rainfall=2.1)
# Summary report
print(gdf.agri.summary())
CLI
# Compute NDVI
AgriScope compute-ndvi fields.geojson --red red --nir nir
# Soil zones
AgriScope soil-zones fields_ndvi.geojson --n-clusters 4
# Irrigation needs
AgriScope irrigation-needs fields_zones.geojson --et0 5.2 --rain 2.1
# Summary
AgriScope summary fields_final.geojson
# JSON output for pipeline use
AgriScope summary fields_final.geojson --json-output | jq .ndvi
Features
| Method | Description |
|---|---|
gdf.agri.compute_ndvi(red, nir) |
NDVI from column names or arrays |
gdf.agri.sample_raster(path, band) |
Sample raster at geometry locations |
gdf.agri.soil_zones(method, n_clusters) |
KMeans / DBSCAN / Agglomerative zoning |
gdf.agri.irrigation_needs(et0, rain) |
Water-balance irrigation recommendations |
gdf.agri.compute_ndvi_chunked(...) |
Chunked NDVI for very large datasets |
gdf.agri.summary() |
NDVI stats, zone distribution, irrigation counts |
Project Structure
geopandas_agri/
├── __init__.py # Package entry; registers accessor
├── accessor.py # Thin routing layer (@pd.api.extensions accessor)
├── ndvi.py # NDVI formula + raster sampling
├── soil.py # Clustering-based soil zonation
├── irrigation.py # Water-balance irrigation model
├── utils.py # Shared validation + numeric helpers
└── cli.py # Click CLI commands
Development
git clone https://github.com/your-org/AgriScope-V1
cd AgriScope
pip install -e ".[dev]"
pytest
Roadmap / Future Extensions
-
Crop classification — integrate satellite time-series (Sentinel-2 / Landsat) with a scikit-learn or LightGBM classifier to map crop types per field.
-
Yield prediction — regression models (XGBoost / neural nets) trained on historical NDVI trajectories, soil attributes, and weather data to predict per-field yield before harvest.
-
Climate data integration —
gdf.agri.attach_era5(date_range)to automatically download ERA5 reanalysis data (viacdsapi) and join precipitation, temperature, and wind speed to field geometries.
License
MIT © 2024 Agricultural GeoData Team
Project details
Release history Release notifications | RSS feed
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 agriscope-0.1.1.tar.gz.
File metadata
- Download URL: agriscope-0.1.1.tar.gz
- Upload date:
- Size: 19.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 |
9257f366c9af0d80caedbe2221bb6f8173212097d93f5568023a3ba7fb5d8bde
|
|
| MD5 |
3acac15bcbea4c94097c4669325725dd
|
|
| BLAKE2b-256 |
1bf13280b57a2c845c5df8cd15a5d4b18182e5935fa7b93989db13a8b054a5ec
|
File details
Details for the file agriscope-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agriscope-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.3 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 |
c9374ed6ec10cf01bdc8a038a7665a104ecf497ac9d968c994e6635f24953987
|
|
| MD5 |
5c2e043555a473706f22d7aab28e1f9d
|
|
| BLAKE2b-256 |
e0672f5a7ba7eccb1e883811f5473216e46b65b475c73bf16d13c0825a6cad7a
|