Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gde-exporter
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Dynamic ExposureDynamic Exposure
  • Global Dynamic ExposureGlobal Dynamic Exposure
  • gde-exporter
  • Merge requests
  • !7

Added feature to export to GeoSummary format

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Cecilia Nievas requested to merge feature/export_tile_geosummary into main Aug 03, 2022
  • Overview 0
  • Commits 2
  • Pipelines 1
  • Changes 11

This MR:

  • adds the capability to export the GDE model to what is being called a "GeoSummary" format; the output consists of a GeoPackage (.gpkg) file that summarises relevant values per quadtile;
  • fixes an issue of compatibility of geometry types to append to GPKG that arose in the functionality to export to OpenQuake while testing this new feature.

Details on the capability to export the GDE model to the "GeoSummary" format:

The output GeoPackage (.gpkg) file has name pattern [quadkeys_group]_[occupancy_case]_geosummary_tiles.gpkg and contains the following fields:

  • quadkey (str): Quadkey of the tile.
  • geometry (geometry): Geometry of the tile.
  • [occupancy_case]_number_data_units: Number of data units associated with this quadtile and occupancy case.
  • [occupancy_case]_[building_type]_buildings: Number of buildings in the tile of the type building_type (each of the elements of buildings_to_export specified in the configuration file) and of occupancy_case.
  • [occupancy_case]_[building_type]_XXX: Fields in which occupancy_case and building_type have the same meaning as above, and XXX refers to:
    • Columns associated with building replacement costs, whose name and contents are user-defined (cost_cases specified in the configuration file).
    • Columns associated with the number of people in the building at different times of the day, whose names and contents are user-defined (people_cases specified in the configuration file). In all of the cost- and people-cases columns, the values stored correspond to the sum of all buildings in the tile of the corresponding occupancy_case and building_type ([occupancy_case]_[building_type]_buildings field).

Details on the issue of compatibility of geometry types to append to GPKG:

When appending to a GPKG file, the geometry types of the existing file and the data to be appended need to be the same. While trying out the code I encountered cases of OBM buildings whose geometries are defined as MultiPolygons instead of Polygons. If the GPKG file is first created first with only Polygon geometries, then geopandas throws an error when trying to append MultiPolygon geometries. This was addressed by converting all OBM footprints to MultiPolygons when retrieving data using DatabaseQueries.get_GDE_buildings. It was done there because that method was already looping through OSM IDs, while adding this check elsewhere would make the code loop again.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature/export_tile_geosummary