Using the MS Building Footprint osc with Daylight Distribution
Posted by L Freil on 4 September 2020 in English. Last updated on 11 September 2020.The MS Building Footprint dataset is now available to use with Daylight. I am part of the Microsoft Open Maps team, and I work with the team that produces the MS Buildings OSC. Seeing some questions and feedback from the OSM community regarding how to use the dataset, my goal is to make it an option for users to easily import the building footprints.
The goal of the MS Buildings OSC effort is to make sure that the building footprint IDs did not collide with current or future OSM Ids. Negative IDs were used in the ms-ml-buildings-v0.3.osc.bz2 and prior versions as it is discussed as a useful approach in the OSM wiki https://wiki.openstreetmap.org/wiki/OsmChange. Unfortunately, some of the tools used to work directly with planet files and changesets do not fully support working with negative IDs so here are some approaches using the existing tools for community members to use the MS building OSC. I investigated some workflows that use a changeset with negative IDs ms-ml-buildings-v0.3.osc.bz2, and for this release there is also a second changeset that uses positive IDs ms-ml-buildings-v0.3-positive.osc.bz2.
There are two different workflows that were tested that work with the Daylight Distribution and MS Building Footprints to create map tiles using only open source tools.
Workflow 1:
Use Osmium to apply .osc to the Daylight pbf and fix negative IDs before importing them to PostgreSQL database. Steps:
-
Use Osmium to apply the changes to the planet file. Example: “osmium apply-changes planet-v0.3.osm.pbf ms-ml-buildings-v0.3.osc.bz2 -o daylight-and-ms-ml-buildings-v0.3.pbf”
-
Use Osmium to reorder IDs. Example: “osmium renumber daylight-and-ms-ml-buildings-v0.3.pbf -o ordered-daylight-and-ms-ml-buildings-v0.3.pbf”
-
Use osm2pgsql to import the output PBF from previous steps
Workflow 2:
Import Daylight pbf then import MS Buildings