Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge hazard update with main #73

Merged
merged 4 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 41 additions & 7 deletions hydromt_fiat/fiat.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please uncomment the code that you commented out to make it work in future commits, as now I have to resolve the issues in the merge.

Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def setup_config(self, **kwargs):
global_settings[k] = kwargs[k]

self.config["global"] = global_settings

def setup_basemaps(
self,
region,
Expand Down Expand Up @@ -153,8 +153,8 @@ def setup_exposure_vector(
self.exposure.check_required_columns()

def setup_exposure_raster(self):
NotImplemented

NotImplemented
def setup_hazard(
self,
map_fn: str,
Expand All @@ -166,20 +166,32 @@ def setup_hazard(
chunks,
risk_output: bool = True,
hazard_type: str = "flooding",
name_catalog: str = "flood_maps",
maps_id: str = "RP",

):
hazard = Hazard()
hazard.setup_hazard(

hazard.checkInputs(
self,
hazard_type=hazard_type,
risk_output=risk_output,
map_fn=map_fn,
map_type=map_type,
chunks=chunks,
rp=rp,
crs=crs,
nodata=nodata,
var=var,
)

hazard.readMaps(
self,
name_catalog=name_catalog,
hazard_type=hazard_type,
risk_output=risk_output,
crs=crs,
nodata=nodata,
var=var,
chunks=chunks,
region=self.region,
)

# Store the hazard settings.
Expand All @@ -200,6 +212,8 @@ def setup_hazard(
hazard_settings["spatial_reference"] = map_type
self.config["hazard"] = hazard_settings



def setup_social_vulnerability_index(
self, census_key: str, path: str, state_abbreviation: str
):
Expand Down Expand Up @@ -291,12 +305,30 @@ def write(self):
self.tables.append(
(self.exposure.exposure_db, exposure_output_path, {"index": False})
)
# self.tables.append(
# (
# self.vulnerability.vulnerability,
# vulnerability_output_path,
# {"index": False, "header": False},
# )
# )
# self.tables.append(
# (self.exposure.exposure_db, exposure_output_path, {"index": False})
# )

# # Store the vulnerability settings in the config file.
# self.config["vulnerability"] = {"dbase_file": vulnerability_output_path}

# Store the exposure settings in the config file.
self.config["exposure"] = {
"dbase_file": exposure_output_path,
"crs": self.exposure.crs,
}
# # Store the exposure settings in the config file.
# self.config["exposure"] = {
# "dbase_file": exposure_output_path,
# "crs": self.exposure.crs,
# }

if self.config: # try to read default if not yet set
self.write_config()
Expand Down Expand Up @@ -333,3 +365,5 @@ def _configwrite(self, fn):
"""Write config to Delft-FIAT configuration toml file."""
# Save the configuration file.
Config().save(self.config, Path(self.root).joinpath("settings.toml"))


Loading