Commit c158a935 authored by Cecilia Nievas's avatar Cecilia Nievas
Browse files

Added script to create data_units table

parent caff75bc
Pipeline #30835 passed with stage
in 1 minute and 23 seconds
......@@ -33,13 +33,29 @@ Created and managed by [inyuu](https://git.gfz-potsdam.de/dynamicexposure/openbu
| hash | varchar(60) |
| executed_at | timestamp |
#### `data_units` - Information about data-units
Data-units are the smallest geographical unit where an exposure model is defined, i.e. where
data is available from an input aggregated exposure model for a particular occupancy case.
Consequently, the primary key of this table consists of three fields: `data_unit_id`,
`occupancy_case` and `aggregated_source_id`.
| column name | data type | description |
|-----------------------------------|-----------|---------------------------------------------------------------------------|
| data_unit_id | varchar | Identifier of the data unit. |
| occupancy_case | enum | E.g. residential, commercial, industrial, ... |
| aggregated_source_id | smallint | Identifier of the source of the aggregated model. |
| exposure_entity | char(3) | Identifier of the exposure entity. If a country, ISO3 code. |
| buildings_total | float | Total number of buildings as per the aggregated exposure model. |
| dwellings_total | float | Total number of dwellings as per the aggregated exposure model. |
| people_census | float | Total number of census people as per the aggregated exposure model. |
| cost_total | float | Total replacement cost of buildings as per the aggregated exposure model. |
#### `data_unit_tiles` - Information about data-unit tiles
Data-unit tiles result from the intersection of data units with zoom level 18 quadtiles. Data
units are the smallest geographical unit where an exposure model is defined, i.e. where data is
available from an input aggregated exposure model for a particular occupancy case. Consequently,
the primary key of this table consists of four fields: `quadkey`, `aggregated_source_id`,
`occupancy_case` and `data_unit_id`.
Data-unit tiles result from the intersection of data units with zoom level 18 quadtiles.
Consequently, the primary key of this table consists of four fields: `quadkey`,
`aggregated_source_id`, `occupancy_case` and `data_unit_id`.
| column name | data type | description |
|-----------------------------------|---------------|-----------------------------------------------------------------------|
......
CREATE TABLE public.data_units
(
data_unit_id VARCHAR,
occupancy_case occupancycase,
aggregated_source_id SMALLINT,
exposure_entity CHAR(3),
buildings_total FLOAT,
dwellings_total FLOAT,
people_census FLOAT,
cost_total FLOAT,
PRIMARY KEY (data_unit_id, occupancy_case, aggregated_source_id)
);
ALTER TABLE public.data_units
OWNER TO postgres;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment