Install
openclaw skills install @ruiduobao/global-surface-waterDownload JRC Global Surface Water data layers including occurrence, change, seasonality, recurrence, transition, and extent. Data derived from 3+ years of Landsat imagery (1984-2024) at 30m resolution. Supports bbox clipping and GeoTIFF output.
openclaw skills install @ruiduobao/global-surface-waterDownload surface water data from the JRC Global Surface Water Explorer — derived from 30+ years of Landsat imagery at 30m resolution.
The JRC Global Surface Water dataset maps the location and temporal distribution of surface water from 1984 to 2024. It uses the entire Landsat 5, 7, and 8 archive to produce 6 data layers describing surface water dynamics.
| Layer | ID | Description |
|---|---|---|
| occurrence | occurrence | Percentage of water detection (0-100%) |
| change | change | Change in water occurrence (gain/loss) |
| seasonality | seasonality | Number of months with water (1-12) |
| recurrence | recurrence | Frequency of water recurrence (1-11) |
| transition | transition | Transitions between water classes |
| extent | extent | Maximum water extent (binary) |
| max_extent | max_extent | Maximum water extent layer |
The JRC data is tiled globally. This skill generates download URLs for the tiles intersecting your bbox and downloads them as GeoTIFF.
If you have geemap or earthengine-api installed, you can use GEE for more
flexible subsetting:
import ee
ee.Initialize()
dataset = ee.Image('JRC/GSW1_4/GlobalSurfaceWater')
occurrence = dataset.select('occurrence')
# Download water occurrence for a region
python scripts\global_surface_water.py download \
--layer occurrence \
--bbox 116.0 39.5 116.8 40.2 \
--output ./water/beijing_occurrence.tif
# Download seasonality layer
python scripts\global_surface_water.py download \
--layer seasonality \
--bbox 73 18 135 54 \
--output ./water/china_seasonality.tif
# Download all layers for a small area
python scripts\global_surface_water.py download \
--layer all \
--bbox 116.3 39.8 116.5 40.0 \
--output ./water/beijing_all/
# List available layers
python scripts\global_surface_water.py list-layers
# Show dataset info
python scripts\global_surface_water.py info
--layer: Layer name (occurrence, change, seasonality, recurrence, transition, extent, max_extent, all)--bbox: Bounding box as west south east north--output: Output file path or directory--version: Dataset version (default: v1_4)--tile-size: Tile size in degrees (default: 10)The JRC Global Surface Water data is organized in 10° × 10° tiles. Each tile is approximately 300-600 MB. The skill automatically identifies which tiles intersect your bounding box and downloads them.
# Install dependencies
pip install requests>=2.28.0 tqdm
# Or install from requirements.txt
pip install -r scripts/requirements.txt
@article{pekel2016high,
title={High-resolution mapping of global surface water and its long-term changes},
author={Pekel, J.F. and Cottam, A. and Gorelick, N. and Belward, A.S.},
journal={Nature},
volume={540},
pages={418--422},
year={2016},
doi={10.1038/nature20584}
}
Transition layer classes:
| Value | Description |
|---|---|
| 1 | Permanent water |
| 2 | New permanent water (gained) |
| 3 | Lost permanent water |
| 4 | Seasonal water |
| 5 | New seasonal water |
| 6 | Lost seasonal water |
| 7 | Permanent to seasonal |
| 8 | Seasonal to permanent |
| 9 | Ephemeral permanent |
| 10 | Ephemeral seasonal |
| 11 | No water |
Recurrence scale (1–11):
| Value | Meaning |
|---|---|
| 1 | Seasonal (least frequent) |
| 2–5 | Low recurrence |
| 6–8 | Moderate recurrence |
| 9–10 | High recurrence |
| 11 | Permanent (most frequent) |
Change layer values:
| Value | Meaning |
|---|---|
| 0 | No change |
| 1 | New water (gain) |
| 2 | Lost water |
extent vs max_extent:
| Error | Cause | Solution |
|---|---|---|
ConnectionError | Network issue or API down | Check internet connection, retry in 1 minute |
HTTP 429 | Rate limit exceeded | Wait 60 seconds before retrying |
HTTP 404 | Invalid parameters or date range | Check parameter names and date format |
ValueError: bbox | Invalid bounding box | Ensure format is west,south,east,north |
| Empty output | No data for query region/time | Try different date range or check coordinates |
ModuleNotFoundError | Missing dependency | Run pip install requests tqdm |
| Disk full | Large tile downloads | Free space or reduce bbox size |
# Download occurrence layer for multiple tiles
for tile in "40N_110E" "40N_120E" "30N_110E" "30N_120E"; do
lat=$(echo $tile | grep -oP '^\d+')
lon=$(echo $tile | grep -oP '_\K\d+')
python scripts\global_surface_water.py download --layer occurrence --tile $tile --output water_${tile}.tif
done
# .github/workflows/update-water.yml
name: Update Surface Water
on:
schedule:
- cron: '0 0 1 1 *' # Yearly
jobs:
download:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install requests
- run: |
python scripts\global_surface_water.py download \
--layer occurrence --tile 40N_110E \
--output data/water_occ_40N_110E.tif
# Mosaic multiple tiles
gdal_merge.py -o water_china.tif water_*.tif
# Reproject to UTM
gdalwarp -t_srs EPSG:32649 water_china.tif water_china_utm.tif
raster2pgsql -s 4326 -I -C water_china.tif public.jrc_water | psql -d gis_db
gdal_translate -a_nodata 0 to set nodata for visualizationchange layer and filter pixels with value 1 (gain) or 2 (loss)下载 JRC 全球地表水数据 —— 基于 30+ 年 Landsat 影像(1984-2024),30 米分辨率。
| 图层 | ID | 描述 |
|---|---|---|
| occurrence | occurrence | 水体出现频率 (0-100%) |
| change | change | 水体变化(增加/减少) |
| seasonality | seasonality | 有水月份数 (1-12) |
| recurrence | recurrence | 水体重现频率 (1-11) |
| transition | transition | 水体类型转换 |
| extent | extent | 最大水体范围(二值) |
| max_extent | max_extent | 最大水体范围图层 |
JRC 数据按全球分块存储。本工具自动生成与您的边界框相交的数据块下载链接, 并下载为 GeoTIFF 格式。
如果已安装 geemap 或 earthengine-api,可使用 GEE 进行更灵活的裁剪:
import ee
ee.Initialize()
dataset = ee.Image('JRC/GSW1_4/GlobalSurfaceWater')
occurrence = dataset.select('occurrence')
# 下载北京区域水体出现频率
python scripts\global_surface_water.py download \
--layer occurrence \
--bbox 116.0 39.5 116.8 40.2 \
--output ./water/beijing_occurrence.tif
# 下载中国区域季节性图层
python scripts\global_surface_water.py download \
--layer seasonality \
--bbox 73 18 135 54 \
--output ./water/china_seasonality.tif
# 下载小区域所有图层
python scripts\global_surface_water.py download \
--layer all \
--bbox 116.3 39.8 116.5 40.0 \
--output ./water/beijing_all/
# 列出可用图层
python scripts\global_surface_water.py list-layers
# 查看数据集信息
python scripts\global_surface_water.py info
JRC 全球地表水数据按 10° × 10° 分块存储。每个数据块约 300-600 MB。 工具自动识别与您的边界框相交的数据块并下载。