Skip to content

Commit

Permalink
create output folder with aggregation areas/additional attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Santonia27 committed Dec 12, 2023
1 parent bf101c8 commit e753f94
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hydromt_fiat/fiat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import pandas as pd
from hydromt.models.model_grid import GridModel
from shapely.geometry import box
import os
import shutil

from hydromt_fiat import DATADIR
from hydromt_fiat.config import Config
Expand Down Expand Up @@ -98,6 +100,7 @@ def setup_output(
output_dir: str = "output",
output_csv_name: str = "output.csv",
output_vector_name: Union[str, List[str]] = "spatial.gpkg",

) -> None:
"""Setup Delft-FIAT output folder and files.
Expand Down Expand Up @@ -733,6 +736,18 @@ def setup_aggregation_areas(
self.exposure.exposure_db = join_exposure_aggregation_areas(
exposure_gdf, aggregation_area_fn, attribute_names, label_names
)
additional_att = Path(self.root).joinpath("output" , "additional_attributes")
if not os.path.exists(additional_att):
os.makedirs(additional_att)

if isinstance(aggregation_area_fn,list):
for file in aggregation_area_fn:
shutil.copy2(file, additional_att)
else:
shutil.copy2(aggregation_area_fn, additional_att)


# TODO loop over file names and copy into self.root (create directory (aggregation and BF))

def setup_building_footprint(
self,
Expand All @@ -759,6 +774,7 @@ def setup_building_footprint(
building_footprint_fn,
attribute_name,
)
# TODO: loop over file names and copy into self.root (create directory (aggregation and BF))

# Update functions
def update_all(self):
Expand Down

0 comments on commit e753f94

Please sign in to comment.