城市人口估算 | Urban Population Estimation
Estimates the spatial distribution of population density from building volume, night lights and land-use weights, supporting population spatialization and urban research.
Core algorithm: building volume = footprint area × height; residential weight = volume × night-light correction × LULC weight (water/vegetation weights are 0); population is allocated proportionally to weights, density = weight/Σweight × total population/pixel area. Key property: Σ(density × pixel area) = total population — the population total is strictly conserved.
Dependencies / 依赖
pip install 'numpy' 'rasterio'
Usage / 使用方法
Basic Usage
python geoskill-urban-population-estimation.py --bbox 116.0 39.0 117.0 40.0 [other parameters]
Examples
Example 1 (Synthetic Data (Offline))
python geoskill-urban-population-estimation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
Example 2 (Usage 2)
python geoskill-urban-population-estimation.py --input height.tif --nightlight nl.tif --lulc lulc.tif --output-dir ./out
Example 3 (Usage 3)
python geoskill-urban-population-estimation.py --bbox 121.0 31.0 122.0 32.0 --total-population 500000 --output-dir ./out --quiet
Example 4 (Usage 4)
python geoskill-urban-population-estimation.py --input height.tif --total-population 200000 --pixel-size 30 --output-dir ./out
Example 5 (Usage 5)
python geoskill-urban-population-estimation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --total-population 80000 --output-dir ./out --quiet
Output / 输出
| File | Format | Description |
|---|---|---|
population_density.tif |
GeoTIFF | Population density (people per unit area) |
population_stats.json |
JSON | Target/estimated total population, conservation error, mean/max density |
output-manifest.json |
JSON | Run manifest |
Data Source / 数据源 / Source
Local building height + night light + LULC GeoTIFFs; --synthetic mode simulates a comparative scenario of residential areas versus water/vegetation areas.
Privacy / 隐私声明 / Privacy
- Runs offline by default;
--syntheticmode requires no network at all. - All processing is done locally; user data is never uploaded.
License / License
MIT
name: geoskill-urban-population-estimation description: 'Estimate population density from building volume, residential ratio, night-light correction and land-cover weights with total conservation.'
城市人口估算 | Urban Population Estimation
从建筑体积、夜光与土地利用权重估算人口密度空间分布,服务于人口空间化与城市研究。
核心算法:建筑体积 = 足迹面积×高度;居住权重 = 体积×夜光校正×LULC 权重(水体/植被权重为 0);人口按权重归一化分配,density = weight/Σweight × 总人口/像元面积。关键性质:Σ(density×像元面积) = 总人口,人口总量严格守恒。
依赖
pip install 'numpy' 'rasterio'
使用方法
基本用法
python geoskill-urban-population-estimation.py --bbox 116.0 39.0 117.0 40.0 [其他参数]
示例
示例 1(合成数据(离线))
python geoskill-urban-population-estimation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
示例 2(用法 2)
python geoskill-urban-population-estimation.py --input height.tif --nightlight nl.tif --lulc lulc.tif --output-dir ./out
示例 3(用法 3)
python geoskill-urban-population-estimation.py --bbox 121.0 31.0 122.0 32.0 --total-population 500000 --output-dir ./out --quiet
示例 4(用法 4)
python geoskill-urban-population-estimation.py --input height.tif --total-population 200000 --pixel-size 30 --output-dir ./out
示例 5(用法 5)
python geoskill-urban-population-estimation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --total-population 80000 --output-dir ./out --quiet
输出
| 文件 | 格式 | 说明 |
|---|---|---|
population_density.tif |
GeoTIFF | 人口密度(人/单位面积) |
population_stats.json |
JSON | 目标/估算总人口、守恒误差、密度均值/最大值 |
output-manifest.json |
JSON | 运行清单 |
数据源 / Source
本地建筑高度 + 夜光 + LULC GeoTIFF;--synthetic 模式模拟居住区与水体/植被区的对照场景。
隐私声明 / Privacy
- 默认离线运行,
--synthetic模式完全无网络。 - 所有处理在本地完成,不上传用户数据。
License
MIT
