colouring-montreal/etl/update_building_records.sh
2022-04-14 09:28:34 +01:00

14 lines
416 B
Bash

#!/usr/bin/env bash
# for TOID in geometries
# if geometry.TOID not in builings
# INSERT
# add build date
# for TOID in buildings
# for each building.coordinates <10m away from a building.coordinates
# Mark one with older build date (or blank) as demolish date = build date of the new one
psql -c "INSERT INTO buildings ( geometry_id, ref_toid ) SELECT geometry_id, source_id from geometries;"