OpenStreetMap logo OpenStreetMap

Automation of buildings and addresses

Posted by PGW77 on 27 March 2021 in English.

Automate the creation of buildings and address tags using Microsoft’s AI building footprints.

Load the building footprints into QGIS and save into a shape file limited by the canvas bounds.

Iterate through each geometry and convert to polygon.

Check if polygon contains the address point.

If it does, then save address information and building polygon for import.

If any address points remain that have not been assigned a building polygon, then add them to the map as an addressed point.

When automating the creation of the ways and nodes, get the map for the bounds of the new element and check if it has already been created. This can be done by using OSMSharp on a freshly downloaded PBF or by querying the live map by bounds.

Upload changesets by zipcode in batches or 1000 to 2000. Possible add tag to specify your import.

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Comment from lyx on 27 March 2021 at 12:45

I think there are a lot of things missing in this process, e.g. conflation of data with what is in the OSM database already. As OSM has no concept of layers, just importing stuff “over” the existing data is bound to create a mess. For a successful import it is really necessary to follow the import guidelines as set out in osm.wiki/Import/Guidelines

Comment from n76 on 27 March 2021 at 17:20

I concur the @lyx there are a number of steps missing in the processing you describe.

In addition, at least for my area, the Microsoft AI building outlines are not very good. Certainly not up to my personal standards.

I did a partial import of open data from my local county where they had conflated Microsoft buildings with their address data. I started off trying to import the buildings and the addresses and found that I had to redraw nearly all the buildings. So I changed to simply importing (and conflating with existing OSM data) the address data. Even that needed enough manual intervention that I only did about 1/2 the county (the half that I live in).

Importing data is not an easy job to do well. You need to follow the guidelines @lyx linked to. That is not all the hard to do: Mostly announce it properly, create a wiki page describing your process, etc.

The hard part is actually doing the work well which includes properly handling cases where there are partial addresses in OSM which need to be conflated with your import data. Or cases where the same address shows up in more than one location. Or cases where the street name in your address import doesn’t match any near by street. Or. . . Well there are lots of ways the data could need some attention.

Comment from PGW77 on 27 March 2021 at 18:31

I’ve been thinking about data duplication from the start, even though i failed to mention it in my entry.

I’ve pre-processed my data in a sql table. The next step is to identify existing nodes and ways that match my address/building dataset and update my records with the node_id or way_id that already associate with it. I’ll do this by downloading a recent OSM of my county, extract the nodes and ways and compare them to my data set. I’ve not come up with the exact method, but it will probably include using a buffer for nodes with address tags and centroids for existing buildings.

Comment from PGW77 on 27 March 2021 at 18:34

My diary entry is a place to get my thoughts together, obtain valuable feedback (thanks guys :), refine my process. Testing will be done on the dev server and when I feel like it’s ready, I’ll draw up a wiki and see if I can get approval from the community.

Comment from Carnildo on 29 March 2021 at 20:48

You’re missing a critical step: verify the building footprints against what’s actually there. I need to do a proper writeup of it, but in my checking, the Microsoft’s building footprints have an error rate between 10% and 50% depending on the situation (and a fairly consistent 25% non-detection rate).

Comment from PGW77 on 29 March 2021 at 22:10

Thanks for the feedback. I check the existing ways by getting the centroid of its bounding box and see if it exists or intersects with the bounding of the MS building. So far that method has worked pretty well. I will include it in my write up and include a geoJSON of the import for review.

You can download a “in-progress” geoJSON here: https://www.dropbox.com/s/qv7m2ivnf1v8v70/Columbia_County_FLA_Buildings.geojson?dl=0

Comment from PGW77 on 29 March 2021 at 22:12

Also, only the MS buildings that contain my address point are included at them moment. The address point isn’t always centered on the rooftop so those are left off until i figure out how to include them. I will probably query by parcel data and scape those with only one address on the parcel to include more.

Log in to leave a comment