Install
openclaw skills install @ruiduobao/download-dem-skilSelect, discover, download, resume, tile, mosaic, crop, and validate DEM data from Microsoft Planetary Computer, AWS Open Data, OpenTopography, USGS 3DEP, and NASA Earthdata. Use for city-to-country AOIs, multi-source DEM selection, exact vector masks, resumable large-area downloads, GeoTIFF generation, and provenance reporting. 从微软 Planetary Computer、AWS Open Data、OpenTopography、USGS 3DEP 和 NASA Earthdata 选择、检索、下载、续传、分块、拼接、裁剪并验证 DEM;适用于城市到国家尺度、多源数据选择、矢量精确掩膜、大范围断点续传、GeoTIFF 生成和溯源报告。
openclaw skills install @ruiduobao/download-dem-skilUse scripts/dem_download.py for deterministic planning, discovery, transfer, mosaicking, and validation. Keep provider details in references/sources.md. Read references/large-area-workflow.md for provincial, national, interrupted, or high-resolution jobs.
使用 scripts/dem_download.py 完成可复现的规划、检索、传输、拼接和验证。数据源细节见 references/sources.md;省级、国家级、中断恢复或高分辨率任务需阅读 references/large-area-workflow.md。
plan. Report AOI area, bbox-grid pixels, estimated asset count, chosen source, product class, vertical datum, credentials, and selected output mode.
阅读 references/source-selection.md 后运行 plan,报告 AOI 面积、边界框像元数、预计资产数、数据源、产品类型、垂直基准、认证要求和输出模式。--mode auto unless the user explicitly needs a mosaic or raw tiles. Auto-select a mosaic only when AOI area is at most 10,000 km2 and the bbox grid is at most 100 million pixels; otherwise download source assets without mosaicking.
除非用户明确要求拼接或原始瓦片,否则保留 --mode auto。仅当 AOI 不超过 10,000 km2 且边界框不超过 1 亿像元时自动拼接,否则只下载原始资产。download. For large jobs, keep the same output path between attempts so manifest.json and .part files can resume. Use 2-6 workers; start with 4. Do not delete a partial job after a transient failure.
运行 download。大任务重试时保持相同输出路径,以便利用 manifest.json 和 .part 文件续传。并发数使用 2-6,默认从 4 开始;暂时性故障后不要删除未完成任务。validate on the output GeoTIFF or tile directory. Treat missing CRS, corrupt files, empty rasters, incomplete assets, or no AOI overlap as failures.
对输出 GeoTIFF 或瓦片目录运行 validate。缺少 CRS、文件损坏、空栅格、资产不完整或与 AOI 无重叠均视为失败。Run from this skill directory. 在技能目录中运行:
python scripts/dem_download.py sources
python scripts/dem_download.py plan --aoi city.geojson --source auto --dataset cop-dem-glo-30 --mode auto
python scripts/dem_download.py download --aoi city.geojson --source mpc --dataset cop-dem-glo-30 --mode auto --output city_dem.tif
python scripts/dem_download.py download --aoi province.geojson --source aws --dataset cop-dem-glo-30 --mode auto --output province_tiles --workers 4
python scripts/dem_download.py download --aoi country.geojson --source mpc --dataset cop-dem-glo-90 --mode tiles --output country_tiles --workers 6
python scripts/dem_download.py download --bbox 86.7 27.8 87.1 28.1 --source opentopography --dataset SRTMGL1 --output srtm.tif
python scripts/dem_download.py download --bbox 120 30 122 32 --source earthdata --dataset aster-gdem-v3 --output aster.tif
python scripts/dem_download.py validate city_dem.tif
python scripts/dem_download.py validate province_tiles
auto: Select mosaic only when both area and pixel limits pass; otherwise select tiles. 仅当面积和像元数均通过限制时选择 mosaic,否则选择 tiles。mosaic: Stream COG ranges when possible, write the mosaic in bounded-memory windows, and mask vector AOIs block by block. If streaming fails, stage assets with resumable downloads and retry locally. 尽量流式读取 COG,并以受控内存窗口写入拼接结果和分块掩膜;流式读取失败时,续传下载资产后在本地重试。tiles: Download provider assets concurrently into <output>/<source>/, retain manifest.json, preserve .part files after interruption, and do not mosaic or apply an exact AOI mask. Raw assets may extend beyond the AOI. 并发下载到 <output>/<source>/,保留 manifest.json 和中断后的 .part 文件,不拼接也不执行精确 AOI 掩膜;原始瓦片可能超出 AOI。Use --mosaic-max-area-km2 to change the 10,000 km2 threshold and --max-pixels for the bbox-grid limit. Require --allow-large for an explicitly oversized mosaic. Do not use it merely to bypass planning.
使用 --mosaic-max-area-km2 调整 10,000 km2 阈值,使用 --max-pixels 调整边界框像元上限。超限拼接必须显式指定 --allow-large,不要仅为绕过规划而使用。
--verify-existing when storage corruption is a concern. Use validate <tile-dir> --verify-checksums for a full manifest checksum audit. 怀疑存储损坏时使用 --verify-existing;完整清单校验使用 validate <tile-dir> --verify-checksums。--no-resume only to restart transfers. Use --stage-assets when reproducible local inputs matter more than COG range-read efficiency. Use --keep-cache to retain staged mosaic inputs. 仅在需要重新传输时使用 --no-resume;重视本地输入可复现性时使用 --stage-assets;需要保留拼接缓存时使用 --keep-cache。OPENTOPOGRAPHY_API_KEY. The adapter splits requests into geographic chunks and limits concurrency to two. SRTM、NASADEM、AW3D30、COP30/COP90 或 EU-DEM 子集使用 OpenTopography,并设置 OPENTOPOGRAPHY_API_KEY;适配器按地理范围分块并将并发限制为 2。10m or 1m products. Product archives remain raw in tile mode and are securely extracted only for mosaicking. 美国 10m 或 1m 产品使用 USGS 3DEP;瓦片模式保留原始压缩包,仅在拼接时安全解压。aster-gdem-v3. Set EARTHDATA_TOKEN; discovery uses official CMR collection ASTGTM.003 and selects only _dem.tif, not the quality-count band. ASTER GDEM V3 使用 NASA Earthdata 并设置 EARTHDATA_TOKEN;通过官方 CMR 集合 ASTGTM.003 检索,只选择 _dem.tif,不选择质量计数波段。Require Python 3.10+ and rasterio; vector AOIs require fiona; MPC requires pystac-client and planetary-computer. Other providers use the Python standard library. Do not install missing packages without user authorization.
需要 Python 3.10+ 和 rasterio;矢量 AOI 需要 fiona;MPC 需要 pystac-client 和 planetary-computer。其他数据源使用 Python 标准库。未经用户授权不要安装缺失依赖。
Return the effective output path, mode, source, dataset, access time, AOI area, bbox, dimensions or tile count, CRS, resolution, surface type, vertical datum, validation status, NoData/sample statistics when mosaicked, manifest/checksum information when tiled, official source URLs, and any fallback or limitation.
返回实际输出路径、模式、数据源、数据集、访问时间、AOI 面积、边界框、尺寸或瓦片数、CRS、分辨率、表面类型、垂直基准、验证状态;拼接模式还需返回 NoData/样本统计,瓦片模式需返回清单/校验和,并始终附官方来源 URL、回退或限制说明。