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
b611fa57
Commit
b611fa57
authored
Apr 14, 2022
by
Cecilia Nievas
Browse files
Added capacity to handle issues with input boundaries
parent
0641a54c
Pipeline
#41578
passed with stage
in 2 minutes and 28 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
gdeimporter/aggregatedexposuremodel.py
View file @
b611fa57
...
...
@@ -1164,6 +1164,11 @@ class ExposureModelESRM20(AggregatedExposureModel):
sep
=
","
,
)
if
exposure_entity
.
name
==
"France"
and
"ID_5"
in
datatypes
:
data_table
[
"ID_5"
]
=
numpy
.
array
(
[
val
.
zfill
(
5
)
for
val
in
data_table
[
"ID_5"
].
values
]
)
# Fill in data_table with potentially missing columns with default values
to_add_if_non_existent
=
[
self
.
csv_column_names
[
"settlement_type"
],
...
...
@@ -1259,7 +1264,12 @@ class ExposureModelESRM20(AggregatedExposureModel):
geometries_table
=
geopandas
.
GeoDataFrame
.
from_file
(
os
.
path
.
join
(
configuration
.
boundaries_pathname
,
subfolder
,
filename
),
)
geometries_table
=
geometries_table
.
to_crs
(
"EPSG:4326"
)
if
geometries_table
.
crs
is
None
:
# Assume 4326 if CRS definition missing in file
geometries_table
.
crs
=
pyproj
.
CRS
(
"EPSG:4326"
)
else
:
geometries_table
=
geometries_table
.
to_crs
(
"EPSG:4326"
)
# Force data types (dtype=datatypes not working in geopandas.GeoDataFrame.from_file)
geometries_table
=
SpatialTools
.
force_data_types_in_GeoDataFrame
(
...
...
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