Skip to content

Made DatabaseStorage.store_OBM_building_classes() erase first existing database entries

Cecilia Nievas requested to merge fix/erase_old_gde_buildings into master

DatabaseStorage.store_OBM_building_classes() was already checking whether a particular combination of osm_id and ggregated_source_id existed in the gde_buildings database table so as to either update that entry or create a new one. However, it may happen that OBM buildings that used to exist for a particular combination of 'data_unit_id' and 'occupancy_case' and 'aggregated_source_id' no longer exist when the code is re-run. This MR addresses this issue by making DatabaseStorage.store_OBM_building_classes() first erase all entries in the gde_buildings database table associated with the input combination of 'data_unit_id' and 'occupancy_case' and 'aggregated_source_id'.

Merge request reports