A new rule for handling prior building geometry & OSM tags retrieval
Background:
Currently, when adding a building geometry from non-OSM sources before OSM, such as 3D geometry, we insert it with its limited info into database, and later when we attempt to add OSM buildings and their informative tags, a lot of OSM buildings and their tags are rejected due to the confliction (intersection) with the existing geometry (already inserted), leading to missing OSM attributes for the building entities. The result is: geometry is good, since they are from the more accurate datasets; but OSM tags give us many attributes of the buildings, they are not included anymore.
Proposed Solution:
Introduce a new rule in the retrieval pipeline:
- Pre-check intersection: When inserting a new non-OSM building, query OSM for intersecting buildings.
- Tag merge: If intersections exist, select the OSM tags of the intersecting buildings.
-
Tag use: When running rules for
height,occupancy, etc., the OSM tags and the info from the non-OSM buildings will be used at the same time during the process. OSM buildings in the pipeline (2nd order), reject only the geometry of any OSM building that conflicts with existing geometries, but retain its tags for the earlier-inserted building.
Expected Outcome:
- Non-OSM buildings will have OSM tags upfront if overlaps exist.
- No data loss: OSM tags are retained even if geometries are discarded.
Decisions need to make
The building polygon intersection between OSM geometry and 3D footprint geometry is uncertain, they always slightly shift when comparing the spatial location of them. Thus, we need to make a decision for:
- Choose the largest overlapping OSM building and then only return the tags of that OSM building?
- Or, choose the multiple OSM buildings and retrieve the tags for all of them? If so, if the overlapping ratio of OSM building is very small, should we still select it? The very small ratio happens a lot since the slight shift of the location for the same building in different sources.
Solution in current code:
- Choose multiple OSM buildings, because the OSM contains
buildingandbuilding partlabels, it makes sense that a big building geometry intersects with several building parts geometries. - I think an
overlap_ratiois needed for pre-filtering the "small-overlapping" OSM buildings. The filter means that the spatial relation between the excluded OSM building with the inserting 3D building is quite low, we don't want to apply it OSM information to the 3D building as the correct attributes. I choose theoverlap_ratio > 0.1as threshold.