Built area assessment rules
If a building has been modified, the quadkeys connecting that building should be recalculated. As we do not only recalculate the Quadkey itself, but also the ones it intersects, we need to make this rule a bit more elaborate than it previously was.
Algorithm
(1) Select BBox of modified building (SELECT ST_AsText(ST_Envelope(geometry)) FROM obm_buildings WHERE osm_id = {osm_id}
)
(2) Convert MaxX/MinX/MaxY/MinY to tiles (See https://learn.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system#tile-coordinates-and-quadkeys)
(3) Get all Quadkeys from the tile IDs (See https://learn.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system#tile-coordinates-and-quadkeys)
(4) Recalculate geometry of all tiles (All-in function)
Edited by Laurens Oostwegel