🎁 Get the FREE AI Skills Starter GuideSubscribe →
BytesAgainBytesAgain
🦀 ClawHub

worldclim-extract

by @zd200572

Extract bioclimatic variables (BIO1-BIO19) from WorldClim GeoTIFF rasters using sample coordinates (longitude/latitude). Supports automatic download of World...

Versionv1.0.0
💡 Examples

Using the CLI Script

A reusable Python script is provided at {baseDir}/extract_worldclim.py:

# Extract BIO1 (annual mean temp) and BIO12 (annual precipitation) — default
python3 {baseDir}/extract_worldclim.py \
  -i samples.xlsx \
  -o samples_with_climate.xlsx

Extract all 19 bioclimatic variables

python3 {baseDir}/extract_worldclim.py \ -i samples.xlsx \ -o samples_all_bio.xlsx \ --bios 1-19

Extract specific variables with custom column names

python3 {baseDir}/extract_worldclim.py \ -i coords.csv \ -o result.xlsx \ --bios 1,5,6,12,13 \ --res 2.5m \ --lon longitude \ --lat latitude

Using Python Directly

For custom integration or programmatic use:

import pandas as pd
import rasterio

def extract_bio(tif_path, lon, lat): """Extract a single value from a GeoTIFF at given coordinates.""" with rasterio.open(tif_path) as src: value = next(src.sample([(lon, lat)]))[0] return value

Read sample coordinates

df = pd.read_excel("samples.xlsx") coords = list(zip(df["经度"], df["纬度"]))

Extract BIO1 (Annual Mean Temperature)

with rasterio.open("wc2.1_10m_bio_1.tif") as src: df["年均温度_C"] = [v[0] for v in src.sample(coords)]

Extract BIO12 (Annual Precipitation)

with rasterio.open("wc2.1_10m_bio_12.tif") as src: df["年降水量_mm"] = [v[0] for v in src.sample(coords)]

df.to_excel("samples_with_climate.xlsx", index=False)

View on ClawHub
TERMINAL
clawhub install worldclim-extract

🧪 Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

🔍 Can't find the right skill?

Search 60,000+ AI agent skills — free, no login needed.

Search Skills →