Skip to main content

Agricultural geospatial analysis toolkit

Project description

AgriScope-V0.1.1

Agricultural geospatial analysis toolkit extending GeoPandas.

Python License: MIT


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

  1. Crop classification — integrate satellite time-series (Sentinel-2 / Landsat) with a scikit-learn or LightGBM classifier to map crop types per field.

  2. Yield prediction — regression models (XGBoost / neural nets) trained on historical NDVI trajectories, soil attributes, and weather data to predict per-field yield before harvest.

  3. Climate data integrationgdf.agri.attach_era5(date_range) to automatically download ERA5 reanalysis data (via cdsapi) and join precipitation, temperature, and wind speed to field geometries.

License

MIT © 2024 Agricultural GeoData Team

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

agriscope-0.1.1.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

agriscope-0.1.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

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

Hashes for agriscope-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9257f366c9af0d80caedbe2221bb6f8173212097d93f5568023a3ba7fb5d8bde
MD5 3acac15bcbea4c94097c4669325725dd
BLAKE2b-256 1bf13280b57a2c845c5df8cd15a5d4b18182e5935fa7b93989db13a8b054a5ec

See more details on using hashes here.

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

Hashes for agriscope-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9374ed6ec10cf01bdc8a038a7665a104ecf497ac9d968c994e6635f24953987
MD5 5c2e043555a473706f22d7aab28e1f9d
BLAKE2b-256 e0672f5a7ba7eccb1e883811f5473216e46b65b475c73bf16d13c0825a6cad7a

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