Skip to content

Added core function to create cells around SERA industrial points of a country

Cecilia Nievas requested to merge feature/ind05 into master

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 fifth of several that aim at implementing this feature. The following is included in this fifth merge request:

  • Added three functions to GDE_TOOLS_create_industrial_cells.py:
    • generate_country_industrial_cells(): This is the core function of this functionality and uses all other previously added functions. It goes all the way from an input exposure file from an aggregated model of a country to providing as output the associated cells, adjusted to avoid gaps and overlaps. The geometries of the cells are trimmed to lie within the country boundaries. The user can select whether to carry out quality/consistency checks and to keep on adjusting the geometries if one of these checks fails.
    • get_distance_centroids(): This function is one of the consistency checks of generate_country_industrial_cells() and it calculates the distance between the original points in the aggregated exposure model and the centroids of the cells' geometries. It is run before trimming the cells as per the country boundaries.
    • get_relative_area_range(): This function is one of the consistency checks of generate_country_industrial_cells() and it calculates a measure of the variability of the area of the geometries of the cells.
  • Added tests for these functions to test_GDE_TOOLS_create_industrial_cells.py.
  • Added test files needed for the test of generate_country_industrial_cells() to tests/data/GDE_TOOLS_create_industrial_cells.

This feature is associated with dynamicexposure/collaboration#40

Previous merger request: !14 (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

Merge request reports