返回资讯中心
外部精选
软件工程
#开发者实时流

微软发布全球建筑轮廓数据集,收录约14亿栋建筑

来源标题:Microsoft's 1.4B Buildings

微软自2014年起持续发布 GlobalMLBuildingFootprints 数据集,目前已收录全球约14亿栋建筑的轮廓与高度数据,通过机器学习算法分析卫星和航拍影像生成。影像来源包括 Maxar(现更名 Vantor)、Airbus、Vexcel 和法国 IGN 等供应商。相比之下,OpenStreetMap 仅收录全球约6.6亿栋建筑,Overture Maps 上月发布的数据集约含25亿栋。

Hacker News 最新marklit2026/11/24 · 今天30 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Since 2014, Microsoft has published GlobalMLBuildingFootprints, a building footprint and height database covering much of the world.

It's constructed by running machine learning algorithms against satellite and other aerial imagery. The imagery has been sourced from providers such as Maxar (now rebranded as Vantor), Airbus, Vexcel (which was recently acquired for $800M) and IGN France.

In an ideal world, OpenStreetMap would be the single source of truth for building footprints globally. But as of this writing, it has ~660M of the world's estimated 2.75B building footprints. Projects like Overture Maps attempt to mix OpenStreetMap and other datasets, including this one, together to create a more complete building footprint dataset. Last month's Overture release contained ~2.5B buildings, so even then, they're likely ~250M buildings short.

Official government data leaves a lot to be desired. Countries like Canada leave tracking of building footprints up to local authorities, leaving 1000s of authoritative datasets being managed independently. The US has had various e911 programmes trying to build accurate maps of neighbourhoods that were built in the 70s and 80s, for ambulance navigation systems. Even these efforts have some way to go.

I've used six-figure-plus commercial datasets for the US, and even then, you still need to fill in the blanks and are forever awaiting their next refresh.

OpenStreetMap has around ~50K contributors making edits each month. If you were to tell them to do nothing else but outline every building on the planet, it would leave each of them with 41K footprints to complete.

I previously wrote about the ML Buildings dataset in January but since then, there have been several updates. The last release was published two weeks ago.

In this post, I'll examine Microsoft's latest release.

I'm using a 5.7 GHz AMD Ryzen 9 9950X CPU. It has 16 cores and 32 threads and 1.2 MB of L1, 16 MB of L2 and 64 MB of L3 cache. It has a liquid cooler attached and is housed in a spacious, full-sized Cooler Master HAF 700 computer case.

The system has 96 GB of DDR5 RAM clocked at 4,800 MT/s and a 5th-generation, Crucial T700 4 TB NVMe M.2 SSD which can read at speeds up to 12,400 MB/s. There is a heatsink on the SSD to help keep its temperature down. This is my system's C drive.

The system is powered by a 1,200-watt, fully modular Corsair Power Supply and is sat on an ASRock X870E Nova 90 Motherboard.

I'm running Ubuntu 24 LTS via Microsoft's Ubuntu for Windows on Windows 11 Pro. In case you're wondering why I don't run a Linux-based desktop as my primary work environment, I'm still using an Nvidia GTX 1080 GPU which has better driver support on Windows and ArcGIS Pro only supports Windows natively.

I'll use jq to help format data in this post.

$ sudo apt update $ sudo apt install
jq

I'll use DuckDB, along with its H3, JSON, Lindel, Parquet and Spatial extensions in this post.

$ cd ~ $ wget -c https://github.com/duckdb/duckdb/releases/download/v1.5.4/duckdb_cli-linux-amd64.zip $ unzip -j duckdb_cli-linux-amd64.zip $ chmod +x duckdb $ ~/duckdb

INSTALL h3 FROM community; INSTALL lindel FROM community; INSTALL json; INSTALL parquet; INSTALL spatial;

I'll set up DuckDB to load every installed extension each time it launches.

$ vi ~/.duckdbrc

.timer on .width 180 LOAD h3; LOAD lindel; LOAD json; LOAD parquet; LOAD spatial;

The maps in this post were rendered with QGIS version 4.2.3. QGIS is a desktop application that runs on Windows, macOS and Linux. The application has grown in popularity in recent years and has ~22M application launches from users all around the world each month.

I used QGIS' HCMGIS plug-in to add basemaps from Esri to this post.

Below, I'll download the manifest of the 30,108 CSV files that make up this dataset.

$ mkdir -p ~/ms_buildings_2026 $ cd ~/ms_buildings_2026

$ wget https://bfppub.blob.core.windows.net/%24web/2026-11-12/dataset-links.csv

This is an example record from the manifest.

$ echo "FROM 'dataset-links.csv' ORDER BY UploadDate DESC LIMIT 1"
| ~/duckdb -json
| jq -S .

[ { "Location": "Abyei", "QuadKey": "122320113", "Size": "74.7KB", "UploadDate": "2026-11-12", "Url": "https://bfppub.z5.web.core.windows.net/2026-11-12/global-buildings.geojsonl/RegionName=Abyei/quadkey=122320113/part-00108-4b4e6876-7466-49a9-940f-834dab87ccde.c000.csv.gz" } ]

I'll import the manifest into DuckDB and clean up its fields.

$ ~/duckdb

CREATE OR REPLACE TABLE mlb AS SELECT *, region: SPLIT_PART(SPLIT_PART(Url, '/', 7), '=', 2), num_bytes: CASE WHEN Size LIKE '%KB' THEN ((REPLACE(Size, 'KB', '')::FLOAT) * 1024)::BIGINT WHEN Size LIKE '%MB' THEN ((REPLACE(Size, 'MB', '')::FLOAT) * 1024 ** 2)::BIGINT WHEN Size LIKE '%B' THEN ((REPLACE(Size, 'B', ''))::FLOAT)::BIGINT ELSE Size::BIGINT END, unique_key: UUIDv4() FROM 'dataset-links.csv';

The manifest describes the dataset as having a footprint of 113 GB across 30,108 files, all with a publication date of 2026-11-12.

SELECT gb: SUM(num_bytes) / 1024 ** 3 FROM mlb;

┌────────────────────┐ │ gb │ │ double │ ├────────────────────┤ │ 113.66948796715587 │ └────────────────────┘

SELECT UploadDate, COUNT(*) FROM mlb GROUP BY 1;

┌────────────┬──────────────┐ │ UploadDate │ count_star() │ │ date │ int64 │ ├────────────┼──────────────┤ │ 2026-11-12 │ 30108 │ └────────────┴──────────────┘

I'll build a BASH script that will download each CSV file into its own unique filename.

COPY ( SELECT 'wget -c -O source/' || unique_key || '.csv.gz "' || Url || '"' FROM mlb ) TO 'manifest.bash' ( HEADER False, QUOTE '');

The following will download the 30,108 GZIP-compressed CSV files with 16 concurrent downloads at any one time.

$ mkdir -p source

$ cat manifest.bash
| xargs -P16
-I%
bash -c "%"

CSV to Parquet

This dataset suffers from a small-file problem. The largest files are 100s of MB, while the smallest are less than 200 bytes.

$ ls -lS source/*.csv.gz | tail

182 ... 99b08fab-2ebf-448b-b9ad-3aa7492ce8c9.csv.gz 182 ... f30ccf23-221f-44f3-9b7f-890c1c306453.csv.gz 181 ... 2ad25238-6e41-40e7-8f4a-085bef9cadd9.csv.gz 181 ... 2c9d30ef-3f48-4a05-9742-0590591f0d6d.csv.gz 178 ... e5dd124e-c3af-4f8d-9b98-eccc12f3403e.csv.gz 177 ... f1166f5a-89f1-41d0-89cf-d0a3e8066b68.csv.gz 172 ... 2d124da2-5b00-426e-868b-386042b18e13.csv.gz 170 ... b3b8409d-8b1c-46c0-bb96-7b1c96d33c8f.csv.gz 168 ... 7700748c-a364-4b88-bd97-a8dd6474b807.csv.gz 163 ... 798aada6-cedb-4203-9f12-f640d179390e.csv.gz

There are almost 5.5K files in this dataset that are less than 10,000 bytes.

SELECT COUNT(*), num_bytes < 10_000 FROM mlb GROUP BY 2;

┌──────────────┬─────────────────────┐ │ count_star() │ (num_bytes < 10000) │ │ int64 │ boolean │ ├──────────────┼─────────────────────┤ │ 24655 │ false │ │ 5453 │ true │ └──────────────┴─────────────────────┘

The following downloaded all of the GZIP-compressed CSV files. While these files were downloading, I converted each of them into Parquet, cleaning up their height and confidence values in the process. The confidence values were binned to the nearest 10th.

$ mkdir -p parquet

$ while : do for FILENAME in source/*.csv.gz; do echo $FILENAME

BASENAME=basename $FILENAME | cut -d. -f1 OUTPUT="parquet/$BASENAME.parquet"

if [ ! -f $OUTPUT ]; then gunzip -c $FILENAME > working.csv

echo "CREATE OR REPLACE TABLE buildings AS SELECT height: a.properties.height::FLOAT, confidence: a.properties.confidence::FLOAT, geometry: ST_GEOMFROMGEOJSON(a.geometry) FROM (SELECT a: column0::JSON FROM READ_CSV('working.csv', header=false, columns={'column0': 'VARCHAR'}));

COPY( SELECT height: IF(height='-1.0', NULL, height::FLOAT), confidence: IF(confidence='-1.0', NULL, (confidence::FLOAT * 10)::INT / 10), geometry, bbox: {'xmin': ST_XMIN(ST_EXTENT(geometry)), 'ymin': ST_YMIN(ST_EXTENT(geometry)), 'xmax': ST_XMAX(ST_EXTENT(geometry)), 'ymax': ST_YMAX(ST_EXTENT(geometry))} FROM buildings WHERE ST_Y(ST_CENTROID(geometry)) IS NOT NULL ORDER BY HILBERT_ENCODE([ST_Y(ST_CENTROID(geometry)), ST_X(ST_CENTROID(geometry))]::double[2]) ) TO '$OUTPUT' ( FORMAT 'PARQUET', CODEC 'ZSTD', COMPRESSION_LEVEL 22, ROW_GROUP_SIZE 15000); " | ~/duckdb fi done

echo "Finished a pass of the manifest file. Sleeping for 5 minutes.." sleep 300 done

I then merged the 30,108 resulting Parquet files into 16 larger files.

$ mkdir -p merged

$ for PREFIX in ls parquet/ | cut -c1 | sort | uniq; do echo 'Merging Prefix:', $PREFIX,
'file(s):', ls parquet/$PREFIX* | wc -l

echo "COPY( FROM 'parquet/$PREFIX*.parquet' WHERE ST_Y(ST_CENTROID(geometry)) IS NOT NULL ORDER BY HILBERT_ENCODE([ST_Y(ST_CENTROID(geometry)), ST_X(ST_CENTROID(geometry))]::double[2]) ) TO 'merged/$PREFIX.parquet' ( FORMAT 'PARQUET', CODEC 'ZSTD', COMPRESSION_LEVEL 22, ROW_GROUP_SIZE 15000);"
| ~/duckdb done

The above produced 16 Parquet files with a combined 1,397,219,933 records and a disk footprint of 108 GB. The record count is down by 12,628,256 from January's release.

$ ~/duckdb

SELECT COUNT() FROM 'merged/.parquet';

┌────────────────┐ │ count_star() │ │ int64 │ ├────────────────┤ │ 1397219933 │ │ (1.40 billion) │ └────────────────┘

Below is an example record of the resulting dataset.

$ echo "FROM 'merged/*.parquet' WHERE height IS NOT NULL AND confidence IS NOT NULL LIMIT 1"
| ~/duckdb -json
| jq -S .

[ { "bbox": { "xmax": 0.0006295056360983, "xmin": 0.0003971245033618, "ymax": 45.6448614148835, "ymin": 45.64463363946551 }, "confidence": 1.0, "geometry": "POLYGON ((0.0006295056360983 45.64481735763345, 0.0004566795369865 45.6448614148835, 0.0003971245033618 45.6447472118587, 0.0004341571133004 45.64473777139927, 0.0003979000807242 45.644668257954784, 0.0005336997124639 45.64463363946551, 0.0006295056360983 45.64481735763345))", "height": 2.5788192749023438 } ]

Buildings Heatmap

The following is a heatmap of the buildings' locations across the globe.

$ ~/duckdb

CREATE OR REPLACE TABLE h3_3_stats AS SELECT h3_3: H3_LATLNG_TO_CELL( bbox.ymin, bbox.xmin, 3), num_locations: COUNT() FROM 'merged/.parquet' GROUP BY 1;

COPY ( SELECT geometry: H3_CELL_TO_BOUNDARY_WKT(h3_3)::GEOMETRY, num_locations FROM h3_3_stats WHERE ST_XMIN(H3_CELL_TO_BOUNDARY_WKT(h3_3)::geometry) BETWEEN -179 AND 179 AND ST_XMAX(H3_CELL_TO_BOUNDARY_WKT(h3_3)::geometry) BETWEEN -179 AND 179 ) TO 'merged.h3_3_stats.parquet' ( FORMAT 'PARQUET', CODEC 'ZSTD', COMPRESSION_LEVEL 22, ROW_GROUP_SIZE 15000);

Coverage Gaps

I'll build bounding boxes around each of the datasets. This will help reveal gaps in coverage.

COPY( FROM ( SELECT filename, geometry: {'min_x': MIN(bbox.xmin), 'min_y': MIN(bbox.ymin), 'max_x': MAX(bbox.xmax), 'max_y': MAX(bbox.ymax)}::BOX_2D::GEOMETRY FROM READ_PARQUET('parquet/*.parquet', filename=true) GROUP BY 1 ) ORDER BY HILBERT_ENCODE([ST_Y(ST_CENTROID(geometry)), ST_X(ST_CENTROID(geometry))]::double[2]) ) TO 'manifest.parquet' ( FORMAT 'PARQUET', CODEC 'ZSTD', COMPRESSION_LEVEL 22, ROW_GROUP_SIZE 15000);

There are no footprints for North or South Korea, Taiwan, Hong Kong, Macau or Mainland China.

Sparsely inhabited areas of the Middle East and North Africa don't have any coverage either.

There is a ring of low settlement activity around Madrid. This shows up in the bounding boxes not extending much into Madrid's outskirts.

The North West coast of Estonia, despite having settlements, likely didn't meet Microsoft's population density threshold and, as such, isn't covered.

Greenland doesn't have any representation in this dataset.

There is a large gap between Australia and Hawaii where there isn't any coverage, including for New Zealand.

224M buildings in this dataset contain height information. This is down ~585K from January's release.

$ ~/duckdb

SELECT COUNT(), height IS NULL FROM 'merged/.parquet' GROUP BY 2;

┌──────────────┬──────────────────┐ │ count_star() │ (height IS NULL) │ │ int64 │ boolean │ ├──

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →