From 2a7d2a8e92f18d1c2dc63278cb2fdcd4bde10cc0 Mon Sep 17 00:00:00 2001 From: Santonia27 <145111392+Santonia27@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:31:43 +0100 Subject: [PATCH] Read spatial joints (#416) * read spatial joints in read_geoms function * read spatial joints in read_geoms() --- hydromt_fiat/fiat.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hydromt_fiat/fiat.py b/hydromt_fiat/fiat.py index 341675ae..149554b4 100644 --- a/hydromt_fiat/fiat.py +++ b/hydromt_fiat/fiat.py @@ -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: