Calgary Building and Address Import

From OpenStreetMap Wiki
Jump to navigation Jump to search

Calgary Building and Address Import is an ongoing (as of April 2025) one-time import of computer vision-generated building outlines and a parcel address dataset provided by the City of Calgary, covering Calgary, Alberta, Canada. So far most building outlines have been imported but addresses haven't.

Goals

Map all building outlines, with addresses for most residential buildings in the city.

Schedule

2025

Import Data

Background

Data source sites:
https://data.calgary.ca/Base-Maps/Buildings/uc4c-6kbd/about_data
https://data.calgary.ca/Base-Maps/Parcel-Address/9zvu-p8uz/about_data
Data license: https://data.calgary.ca/stories/s/Open-Calgary-Terms-of-Use/u45n-7awa/
Type of license (if applicable): Open Government Licence – City of Calgary
Link to permission (if required):
OSM attribution (if required): https://wiki.openstreetmap.org/wiki/Contributors#Calgary
ODbL Compliance verified: yes

Import Type

One time, using JOSM.

Data Preparation

Data Reduction & Simplification

Building outlines contain a lot of unnecessary nodes so are simplified with geopandas.simplify(tolerance=0.000001, preserve_topology=True), which still doesn't get rid of a lot of unnecessary nodes though.

Tagging Plans

Building outline types (BLDG_CODE_DESC column) are mapped to building=* like this:

Original OSM
School Colleges building=school
Commercial building=commercial
Unclassified building=yes
Residential Garage building=garage
Residential Roof Outline building=residential

Outlines with other categories (like churches and stadiums) are dropped. Bus stop outlines were imported previously in 161645699 (achavi, OSMLab, FacilMap).

Changeset Tags

I didn't know about changeset tags until now so import changesets don't include any special tags, besides the word "import" in the comment and links to the two data sets in source=*.

All building outlines have a source=City of Calgary Digital Aerial Survey building roof outlines added.

Data Transformation

The data is transformed using these Python scripts:

https://github.com/verhovsky/calgary_osm_import/tree/master/buildings

The outlines are shifted slightly to align with Bing imagery, which I assume is correctly aligned in Calgary, the outlines are simplified, outline type is converted to OSM, and the outlines are split into neighborhoods for piecemeal importing.

Addresses are converted into OSM compatible addr:unit=* addr:housenumber=* and addr:street=* tags. The street name in the dataset is in all caps, so the generated name is case-insensitively matched to an existing name=* value of a highway=* way within the Calgary boundary=administrative relation (relation 3227127) to correctly handle street names with "Mc"/"Mac" and "'s". Points that don't match an existing street name are removed.

Data Transformation Results

Not uploaded.

Data Merge Workflow

Workflow

Using JOSM with the Conflation plugin and the Building Colors map paint style.

  • Load the outlines for a neighborhood
  • Search for all building="residential" and Freeze as conflation Subject
  • Load address points for that neighborhood as a new layer
  • Select all points and Freeze as conflation Reference
  • Generate matches
  • Adjust the dataset and conflation selections until you get down to 0 in the "Refence only" and "Subject only" sets of the conflation result
    • Eliminate address points of parcels with no houses or address points of appartment buildings
    • unselect address points of duplexes and terraces, they will be uploaded as points later
    • Re-categorize building outlines that were incorrectly categorized as residential
    • unselect outlines of duplexes/terraces/apartments
    • Move address nodes that are too far away from building outlines to match them
    • Find and fix crossing conflation arrows (always a mistake, idk why the conflation plugin generates them without a warning)
  • Conflate
  • Search for all type:way and set as conflation Reference
  • Download OSM data for the given neigborhood as a new layer
  • Search for building: and set as conflation Subject
  • Generate matches
  • Fix conflicts and conflate

QA

None besides looking at all the data

Discussion

The post to the community forum was sent on 2025-03-05 and can be found here.