Skip to content

Commit

Permalink
Read spatial joints (#416)
Browse files Browse the repository at this point in the history
* read spatial joints in read_geoms function

* read spatial joints in read_geoms()
  • Loading branch information
Santonia27 authored Nov 20, 2024
1 parent 657c114 commit 2a7d2a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hydromt_fiat/fiat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,16 @@ def read_geoms(self):
self.exposure.read_geoms(exposure_fn)

fns = glob.glob(Path(self.root, "geoms", "*.geojson").as_posix())
if self.spatial_joins["aggregation_areas"]:
fns_aggregation = glob.glob(Path(self.root, "geoms", "aggregation_areas","*.geojson").as_posix())
fns.append(fns_aggregation[0])
if self.spatial_joins["additional_attributes"]:
if len(glob.glob(Path(self.root, "geoms", "additional_attributes","*.geojson").as_posix())) > 0:
fns_additional_attributes = glob.glob(Path(self.root, "geoms", "additional_attributes","*.geojson").as_posix())
fns.append(fns_additional_attributes[0])
if len(glob.glob(Path(self.root, "geoms", "building_footprints","*.geojson").as_posix())) > 0:
fns_building_footprints = glob.glob(Path(self.root, "geoms", "building_footprints","*.geojson").as_posix())
fns.append(fns_building_footprints[0])
if len(fns) >= 1:
self.logger.info("Reading static geometries")
for fn in fns:
Expand Down

0 comments on commit 2a7d2a8

Please sign in to comment.