360 Secure SkillHub
360 安全技能中心

geoskill-slum-mapping

本地运行的 Python 命令行工具:读取纹理、建筑密度、人口密度与夜光栅格,按加权综合指数公式计算贫民窟/棚户区指数并分类,输出双波段 GeoTIFF、统计 JSON 与运行清单;--synthetic 模式可用合成数据离线演示。

ruiduobao
ruiduobao
热度 11.51
最近更新 2026-08-04 21:42:13
分类:数据依赖:代码执行 / 读写文件应用场景:数据处理 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add geoskill-slum-mapping
Metadata
name
geoskill-slum-mapping
description
Map slums and shanty areas using a multi-indicator index of texture, building density, night light and population density.

贫民窟/棚户区制图 | Slum Mapping

Maps slums / shanty areas using a multi-indicator composite index, supporting living-environment monitoring and targeted governance.

Core algorithm: the slum index SI = w_tex×texture + w_den×building density + w_pop×population density − w_nl×night light, where each factor is normalized to an absolute physical scale and clipped to [0, 1]. The index increases with texture / density / population and decreases with night light; high texture + high density + dark night light + high population → high index, while formally planned areas (smooth / bright night light) → low index.

Dependencies / 依赖

pip install 'numpy' 'rasterio' 'scipy'

Usage / 使用方法

Basic Usage

python geoskill-slum-mapping.py --bbox 116.0 39.0 117.0 40.0 [other parameters]

Examples

Example 1 (Synthetic Data (Offline))

python geoskill-slum-mapping.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out

Example 2 (Usage 2)

python geoskill-slum-mapping.py --input scene.tif --nightlight nl.tif --population pop.tif --output-dir ./out

Example 3 (Usage 3)

python geoskill-slum-mapping.py --bbox 121.0 31.0 122.0 32.0 --threshold 0.55 --output-dir ./out --quiet

Example 4 (Usage 4)

python geoskill-slum-mapping.py --input scene.tif --kernel-size 7 --output-dir ./out

Example 5 (Usage 5)

python geoskill-slum-mapping.py --bbox 116.0 39.0 117.0 40.0 --synthetic --threshold 0.45 --output-dir ./out --quiet

Output / 输出

File Format Description
slum_index.tif GeoTIFF Two bands: band1 = slum index, band2 = classification mask
slum_stats.json JSON Mean index, slum fraction, mean texture, threshold
output-manifest.json JSON Run manifest

Data Source / 数据源 / Source

Local multi-source rasters (grayscale texture source + density + night light + population); --synthetic mode simulates a scene split evenly between shanty areas and formally planned areas.

Privacy / 隐私声明 / Privacy

  • Runs offline by default; --synthetic mode requires no network at all.
  • All processing is done locally; no user data is uploaded.

License / License

MIT



name: geoskill-slum-mapping description: 'Map slums and shanty areas using a multi-indicator index of texture, building density, night light and population density.'

贫民窟/棚户区制图 | Slum Mapping

用多指标综合指数制图贫民窟/棚户区,服务于人居环境监测与精准治理。

核心算法:贫民窟指数 SI = w_tex×纹理 + w_den×建筑密度 + w_pop×人口密度 − w_nl×夜光,各因子用绝对物理标度归一化后裁剪到 [0,1]。指数随纹理/密度/人口递增、随夜光递减;高纹理 + 高密度 + 暗夜光 + 高人口 → 高指数,正规规划区(平滑/亮夜光)→ 低指数。

依赖

pip install 'numpy' 'rasterio' 'scipy'

使用方法

基本用法

python geoskill-slum-mapping.py --bbox 116.0 39.0 117.0 40.0 [其他参数]

示例

示例 1(合成数据(离线))

python geoskill-slum-mapping.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out

示例 2(用法 2)

python geoskill-slum-mapping.py --input scene.tif --nightlight nl.tif --population pop.tif --output-dir ./out

示例 3(用法 3)

python geoskill-slum-mapping.py --bbox 121.0 31.0 122.0 32.0 --threshold 0.55 --output-dir ./out --quiet

示例 4(用法 4)

python geoskill-slum-mapping.py --input scene.tif --kernel-size 7 --output-dir ./out

示例 5(用法 5)

python geoskill-slum-mapping.py --bbox 116.0 39.0 117.0 40.0 --synthetic --threshold 0.45 --output-dir ./out --quiet

输出

文件 格式 说明
slum_index.tif GeoTIFF 双波段:band1=贫民窟指数,band2=分类掩膜
slum_stats.json JSON 平均指数、贫民窟比例、平均纹理、阈值
output-manifest.json JSON 运行清单

数据源 / Source

本地多源栅格(灰度纹理源 + 密度 + 夜光 + 人口);--synthetic 模式模拟棚户区与正规规划区各半的场景。

隐私声明 / Privacy

  • 默认离线运行,--synthetic 模式完全无网络。
  • 所有处理在本地完成,不上传用户数据。

License

MIT