From f39344a943c985e42902ec596f711c630a569d41 Mon Sep 17 00:00:00 2001 From: Felix Delattre Date: Thu, 25 Mar 2021 19:01:39 +0000 Subject: [PATCH] Separated completeness and area_type fields --- README.md | 29 ++++++++++++------- ...06_separate_area_type_and_completeness.sql | 8 +++++ 2 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 migrations/00006_separate_area_type_and_completeness.sql diff --git a/README.md b/README.md index 14627a7..2312ab4 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ Please add a small reasoning around the following points for each proposed merge | column_name | data_type | |--------------|--------------------| | quadkey | text (primary key) | -| completeness | smallint | +| area_type | bit | +| completeness | float | #### `obm_tiles_geometry` - Geometry information about tiles in WGS84 @@ -42,19 +43,27 @@ Created and managed by [inyuu](https://git.gfz-potsdam.de/dynamicexposure/openbu ## Special attributes +### `area_type` + +The `area_type` value expresses the type of area inside a tile. + +| Value | Description | +|--------|--------------| +| `0000` | Undecidable | +| `0001` | Empty | +| `0010` | Built-up | +| `0100` | Seawater | +| `1000` | Inland water | + ### `completeness` The `completeness` value expresses the state of building completeness for a tile. -| value | meaning | -|-------|-----------------| -| `0` | unknown | -| `1` | complete | -| `2` | almost complete | -| `3` | incomplete | -| `4` | undecidable | -| `5` | water | -| `6` | empty | +| Value | Description | +|-----------|---------------------| +| `NULL` | Unknown, incomplete | +| `[0`-`1[` | Completeness ratio | +| `1` | Complete | ## More information diff --git a/migrations/00006_separate_area_type_and_completeness.sql b/migrations/00006_separate_area_type_and_completeness.sql new file mode 100644 index 0000000..2b26777 --- /dev/null +++ b/migrations/00006_separate_area_type_and_completeness.sql @@ -0,0 +1,8 @@ +ALTER TABLE public.obm_tiles + RENAME COLUMN completeness TO area_type; + +ALTER TABLE public.obm_tiles + ALTER COLUMN area_type [SET DATA] TYPE bit(4); + +ALTER TABLE public.obm_tiles + ADD COLUMN IF NOT EXISTS completeness float; -- GitLab