From 3cdcf985bfed31c13bcc34e4d7f8aab6c0f1c4c3 Mon Sep 17 00:00:00 2001
From: Cecilia Nievas <cnievas@gfz-potsdam.de>
Date: Thu, 2 Jun 2022 10:36:43 +0200
Subject: [PATCH] Added quadkey and geometry columns to gde_buildings

---
 README.md                                        | 2 ++
 migrations/00015_add-fields-to-gde-buildings.sql | 2 ++
 2 files changed, 4 insertions(+)
 create mode 100644 migrations/00015_add-fields-to-gde-buildings.sql

diff --git a/README.md b/README.md
index 170f3d8..3ff4a7b 100644
--- a/README.md
+++ b/README.md
@@ -159,10 +159,12 @@ The primary key of this table consists of two fields: `osm_id` and `aggregated_s
 | aggregated_source_id | smallint            | Identifier of the source of the aggregated model.                                         |
 | occupancy_case       | occupancycase       | See [personalised enumerated types](#personalised-enumerated-types).                      |
 | data_unit_id         | varchar             | Identifier of the data unit the OBM building belongs to.                                  |
+| quadkey              | char(18)            | Quadkey of the zoom-level 18 tile to which the centroid of the building belongs.          |
 | building_class_names | array of varchar    | Building classes as per the [GEM Building Taxonomy](https://github.com/gem/gem_taxonomy). |
 | settlement_types     | array of settlement | See [personalised enumerated types](#personalised-enumerated-types).                      |
 | occupancy_subtypes   | array of varchar    | Details on the occupancy, if relevant to characterise the building classes.               |
 | probabilities        | array of float      | Probabilities of the building belonging to each building class.                           |
+| geometry             | geometry            | Footprint of the building.                                                                |
 
 ## Personalised enumerated types
 
diff --git a/migrations/00015_add-fields-to-gde-buildings.sql b/migrations/00015_add-fields-to-gde-buildings.sql
new file mode 100644
index 0000000..caec6fa
--- /dev/null
+++ b/migrations/00015_add-fields-to-gde-buildings.sql
@@ -0,0 +1,2 @@
+ALTER TABLE public.gde_buildings ADD COLUMN quadkey CHAR(18);
+ALTER TABLE public.gde_buildings ADD COLUMN geometry GEOMETRY;
-- 
GitLab