microsoft / microsoft/GlobalMLBuildingFootprints
Issue retreiving building footprints west of amsterdam around Schipol
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 277
- PR merge metrics
- No merged PRs in 30d
Description
I tried to run the following with a Microsoft planetary computer to get building footprints, but apparently the buildings West of Amsterdam are not showing up?
catalog = pystac_client.Client.open(
"https://planetarycomputer.microsoft.com/api/stac/v1",
modifier=planetary_computer.sign_inplace,
)
collection = catalog.get_collection("ms-buildings")
asset = collection.assets["delta"]
storage_options = {
"account_name": asset.extra_fields["table:storage_options"]["account_name"],
"sas_token": asset.extra_fields["table:storage_options"]["credential"],
}
table = deltalake.DeltaTable(asset.href, storage_options=storage_options)
quadkeys = [
int(mercantile.quadkey(tile))
for tile in mercantile.tiles(*buffer[0].bounds, zooms=9)
]
quadkeys
uris = table.file_uris([("quadkey", "in", quadkeys)])
uris
df = dgd.read_parquet(uris, storage_options=storage_options)
where buffer is a circle around (52.372778, 4.893611)
# Get bounds
minx, miny, maxx, maxy = area_of_interest.total_bounds
min_dist = min([abs(minx-latlng[0]), abs(miny-latlng[1]), abs(maxx-latlng[0]), abs(maxy-latlng[1])])
# Create a GeoDataFrame with the specified point
gdf = gpd.GeoDataFrame(geometry=[Point(latlng[1], latlng[0])], crs=crs)
# The UTM zone number can be calculated from the lnggitude
utm_zone = int((latlng[1] + 180) / 6) + 1
# Determine the hemisphere and assign the appropriate UTM CRS
if latlng[0] >= 0: # Northern Hemisphere
local_utm_crs = f'EPSG:326{utm_zone:02d}'
else: # Southern Hemisphere
local_utm_crs = f'EPSG:327{utm_zone:02d}'
# Reproject to a local UTM CRS
gdf_utm = gdf.to_crs(local_utm_crs)
# Create a 50 km buffer around the point
buffer_circle = gdf_utm.buffer((radius) * 1000) # Convert km to meters
buffer = buffer_circle
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by rerunning the provided Python query for the 50 km buffer around (52.372778, 4.893611), checking the generated UTM bounds, quadkeys, and returned URIs. Compare the queried area with the ms-buildings Delta table coverage and determine whether the missing footprints come from the spatial query or the dataset; document the confirmed cause and reproducible result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100