microsoft / microsoft/GlobalMLBuildingFootprints

Building predictions for Zushi, Japan missing

Open
#117 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
277
PR merge metrics
No merged PRs in 30d

Description

It looks like there might have been a decision to not run inference around Zushi, Japan based on tiles as there is a clear break ~5KM before the coastline.

qgis-bin_JNjxTh95hw

OpenStreetMap doesn't have any building footprints for this area.

qgis-bin_PIrsldFwpL

There is a PLATEAU project by the Japanese government to map out buildings in 3D but they haven't covered Zushi yet. Other Japanese public dataset have points for each of the buildings but no polygon footprints.

Any inference of the buildings in this area would produce a pretty unique dataset.

These were the steps I took to extract the buildings:

$ wget https://minedbuildings.blob.core.windows.net/global-buildings/dataset-links.csv

$ cat dataset-links.csv \
    | ~/duckdb \
            -json \
            -c "SELECT Url
                FROM READ_CSV('/dev/stdin')
                WHERE Location = 'Japan'" \
    | jq '.[].Url' \
    > japan.txt

$ cat japan.txt | xargs -P4 -I% wget -c %

$ ~/duckdb buildings.duckdb
CREATE OR REPLACE TABLE buildings (
    height     DOUBLE,
    confidence DOUBLE,
    geom       GEOMETRY);
$ for FILENAME in *.csv.gz; do
      gunzip -c $FILENAME | gzip -1 > working.jsonl.gz # Fix trailing garbage complaint
  
      echo "INSERT INTO buildings
            SELECT properties.height,
                   properties.confidence,
                   ST_GEOMFROMGeoJSON(geometry) geom
            FROM READ_NDJSON('working.jsonl.gz')" \
          | ~/duckdb buildings.duckdb
  done


$ ~/duckdb buildings.duckdb
COPY(
    SELECT height,
           confidence,
           ST_AsWKB(geom) AS geom
    FROM   buildings
    WHERE  ST_Y(ST_CENTROID(geom)) IS NOT NULL
    AND    ST_X(ST_CENTROID(geom)) IS NOT NULL
    ORDER BY HILBERT_ENCODE([ST_Y(ST_CENTROID(geom)),
                             ST_X(ST_CENTROID(geom))]::double[2])
) TO 'japan.pq' (
    FORMAT 'PARQUET',
    CODEC  'ZSTD',
    ROW_GROUP_SIZE 15000);

Between the trailing garbage complaint when decompressing the GZIP files and some geometry producing NULL centroid coords there might be some other issues at play.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the extraction described with dataset-links.csv, japan.txt, the downloaded *.csv.gz files, and buildings.duckdb. Inspect whether the missing Zushi coverage is caused by source data, decompression, geometry filtering, or the inference pipeline. Done means identifying the cause and documenting or correcting the coverage issue, with a reproducible check for Zushi.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, sql
Domain
data, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.