diff --git a/README.md b/README.md index 310b159475baabeed8bbe5883c515a41d4073716..579281ab6b9dbdae6d7fc19209c21efad08d5fc7 100644 --- a/README.md +++ b/README.md @@ -58,18 +58,22 @@ Data-unit tiles result from the intersection of data units with zoom level 18 qu 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 | -|-----------------------------------|---------------|------------------------------------------------------------------------------------------------------------| -| quadkey | char(18) | Zoom level 18 tile identifier. | -| aggregated_source_id | smallint | Identifier of the source of the aggregated model. | -| occupancy_case | occupancycase | See [personalised enumerated types](#personalised-enumerated-types). | -| exposure_entity | char(3) | Identifier of the exposure entity. If a country, ISO3 code. | -| data_unit_id | varchar | Identifier of the data unit. | -| size_data_unit_tile_area | float | Area of the data-unit tile, in m2. | -| size_data_unit_tile_built_up_area | float | Built-up area within the data-unit tile, in m2. | -| fraction_data_unit_area | float | `size_data_unit_tile_area` / area of the data unit. | -| fraction_data_unit_built_up_area | float | `size_data_unit_tile_built_up_area` / built-up area of the data unit. | -| aggregated_buildings | float | Number of buildings from (`aggregated_source_id`, `occupancy_case`, `data_unit_id`) in the data-unit tile. | +| column name | data type | description | +|-----------------------------------|---------------|----------------------------------------------------------------------------------------------------------------------| +| quadkey | char(18) | Zoom level 18 tile identifier. | +| aggregated_source_id | smallint | Identifier of the source of the aggregated model. | +| occupancy_case | occupancycase | See [personalised enumerated types](#personalised-enumerated-types). | +| exposure_entity | char(3) | Identifier of the exposure entity. If a country, ISO3 code. | +| data_unit_id | varchar | Identifier of the data unit. | +| size_data_unit_tile_area | float | Area of the data-unit tile, in m2. | +| size_data_unit_tile_built_up_area | float | Built-up area within the data-unit tile, in m2. | +| fraction_data_unit_area | float | `size_data_unit_tile_area` / area of the data unit. | +| fraction_data_unit_built_up_area | float | `size_data_unit_tile_built_up_area` / built-up area of the data unit. | +| aggregated_buildings | float | Number of buildings from (`aggregated_source_id`, `occupancy_case`, `data_unit_id`) in the data-unit tile. | +| obm_buildings | smallint | Number of OBM buildings of `occupancy_case` in the data-unit tile. | +| remainder_buildings | float | Number of remainder buildings in the data-unit tile (**Note 1**) . | + +**Note 1**: The `remainder_buildings` are calculated as a function of the `aggregated_buildings`, the `obm_buildings` and the completeness of OpenBuildingMap of the tile. #### `data_units_buildings` - Information about buildings in a data unit @@ -91,13 +95,13 @@ The primary key of this table consists of six fields: `building_class_name`, | occupancy_case | occupancycase | See [personalised enumerated types](#personalised-enumerated-types). | | exposure_entity | char(3) | Identifier of the exposure entity. If a country, ISO3 code. | | data_unit_id | varchar | Identifier of the data unit. | -| proportions | float | Proportions in which this building class (**Note 1**) is present in the data unit. | +| proportions | float | Proportions in which this building class (**Note 2**) is present in the data unit. | | census_people_per_building | float | Number of census-derived people per building (i.e. not accounting for time of the day). | | total_cost_per_building | float | Total replacement cost per building (including structural, non-structural and contents). | | storeys_min | smallint | Minimum number of storeys of the building class. | | storeys_max | smallint | Maximum number of storeys of the building class. | -**Note 1**: A "building class" in this table is defined by the primary key. +**Note 2**: A "building class" in this table is defined by the primary key. #### `exposure_entities_costs_assumptions` - Information about assumptions associated with building replacement costs diff --git a/migrations/00011_add-building-fields-to-data-unit-tiles.sql b/migrations/00011_add-building-fields-to-data-unit-tiles.sql new file mode 100644 index 0000000000000000000000000000000000000000..26eea67c4b911a86e0668c78ee86742e428f3a7b --- /dev/null +++ b/migrations/00011_add-building-fields-to-data-unit-tiles.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.data_unit_tiles ADD COLUMN obm_buildings SMALLINT; +ALTER TABLE public.data_unit_tiles ADD COLUMN remainder_buildings FLOAT;