Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gde_calculations_prototype
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 7
    • Issues 7
    • 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
  • LegacyLegacy
  • gde_calculations_prototype
  • Merge requests
  • !14

Added subsequent functions to create cells around SERA industrial points

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Cecilia Nievas requested to merge feature/ind04 into master May 06, 2021
  • Overview 4
  • Commits 9
  • Pipelines 0
  • Changes 2

The industrial exposure of several European countries is defined in the European Seismic Risk Model 2020 (ESRM20, or SERA model) on a 30-arcsec grid. The ESRM20/SERA files only provide points (lon, lat) in which buildings exist, not the full definition of the 30-arcscec grid. We need to define the polygons of the cells of which the given points are centroids in order to then treat them as the equivalent of "districts" for the industrial case.

This merge request is the fourth of several that aim at implementing this feature. The following is included in this fourth merge request:

  • Added seven functions to GDE_TOOLS_create_industrial_cells.py:
    • auto_adjust_overlaps_gaps(): This function resolves overlaps/gaps between cells by averaging the coordinates of the corresponding boundaries. The inputs include a full GeoDataFrame of cells and another one of their intersections. The function goes one by one each of the intersections. It calls define_threshold_angle(), angles_from_coords(), determine_cardinal_point() and adjust_coord_of_polygons().
    • adjust_coord_of_polygons(): This function adjusts the geometry of the two input polygons so that there is no overlap or gap between them. The relative position of one polygon with respect to another is given as input too and is used to determine which coordinates to adjust, by calling retrieve_coords_to_adjust().
    • retrieve_coords_to_adjust(): This function returns the position of the coordinates that need to be changed in two cells/tiles whose relative position is given by the input string.
    • determine_cardinal_point(): This function "translates" each angle in the input array into a direction in terms of "cardinal points".
    • guarantee_radians(): This function converts the input into radians if given in degrees.
    • angles_from_coords(): This function calculates the angle formed by an east-west line and a segment formed by the two input points.
    • define_threshold_angle(): This function defines the threshold angle to consider one cell at a particular cardinal point with respect to another cell. The threshold angle depends only on the widths of the cells.
  • Added tests to three of these functions to test_GDE_TOOLS_create_industrial_cells.py. The test of the other four functions would be trivial.

This feature is associated with dynamicexposure/collaboration#40

Previous merger request: !13 (merged)

Note: print statements are used to indicate errors/problems as a full logger functionality is not yet part of the prototype code (quite a manual logging system is set up in some core scripts, though; a full logger functionality will probably not be incorporated to the prototype code but go directly in the refactoring).

\approve @fd

\rfc @ds

\fyi @tara @shinde

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