Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dynamic Exposure
Global Dynamic Exposure
gde-importer
Commits
6fd0c02c
Commit
6fd0c02c
authored
Apr 13, 2022
by
Cecilia Nievas
Browse files
Changed file structure to search for ESRM20 boundaries
parent
93647423
Pipeline
#41525
canceled with stage
in 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gdeimporter/aggregatedexposuremodel.py
View file @
6fd0c02c
...
...
@@ -456,6 +456,7 @@ class ExposureModelESRM20(AggregatedExposureModel):
"second"
:
"short"
,
}
self
.
boundary_filename_pattern
=
{
"subfolder"
:
"Adm%s"
,
"filename"
:
"Adm%s_%s.shp"
,
"first"
:
"data_units_level"
,
"second"
:
"name"
,
...
...
@@ -805,6 +806,7 @@ class ExposureModelESRM20(AggregatedExposureModel):
# Check that the data units cover all of the exposure entity; if not, create an
# additional filler unit to "fill in" the gaps
"""
if len(data_units_ids) > 0: # nothing to "fill in" if no data units are defined at all
filler_data_unit_geometry_table = self.ensure_full_geographic_coverage(
exposure_entity_name,
...
...
@@ -854,7 +856,7 @@ class ExposureModelESRM20(AggregatedExposureModel):
},
building_classes_proportions_and_properties,
)
"""
return
def
ensure_full_geographic_coverage
(
...
...
@@ -1248,10 +1250,15 @@ class ExposureModelESRM20(AggregatedExposureModel):
],
getattr
(
exposure_entity
,
self
.
boundary_filename_pattern
[
"second"
]),
)
subfolder
=
self
.
boundary_filename_pattern
[
"subfolder"
]
%
(
exposure_entity
.
occupancy_cases
[
occupancy_case
][
self
.
boundary_filename_pattern
[
"first"
]
]
)
# Read the data file (errors will be handled by geopandas)
geometries_table
=
geopandas
.
GeoDataFrame
.
from_file
(
os
.
path
.
join
(
configuration
.
boundaries_pathname
,
filename
),
os
.
path
.
join
(
configuration
.
boundaries_pathname
,
subfolder
,
filename
),
)
geometries_table
=
geometries_table
.
to_crs
(
"EPSG:4326"
)
...
...
@@ -1295,10 +1302,11 @@ class ExposureModelESRM20(AggregatedExposureModel):
0
,
exposure_entity_name
,
)
subfolder
=
self
.
boundary_filename_pattern
[
"subfolder"
]
%
(
0
)
# Read the data file (errors will be handled by geopandas)
geometries_table
=
geopandas
.
GeoDataFrame
.
from_file
(
os
.
path
.
join
(
configuration
.
boundaries_pathname
,
filename
),
os
.
path
.
join
(
configuration
.
boundaries_pathname
,
subfolder
,
filename
),
)
geometries_table
=
geometries_table
.
to_crs
(
"EPSG:4326"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment