damagescanner.vector
Module Contents
Functions
|
Matches the resolution and extent of a raster to a vector file. |
Function to remove overlap in polygons in from OpenStreetMap. |
|
|
Function to extract value from column from other GeoDataFrame |
|
Function to reproject a GeoDataFrame to a different CRS. |
|
" |
- damagescanner.vector.match_raster_to_vector(hazard, landuse, lu_crs, haz_crs, resolution, hazard_col)[source]
Matches the resolution and extent of a raster to a vector file.
- Arguments:
hazard : netCDF4 with hazard intensity per grid cell. landuse : netCDF4 with land-use information per grid cell. lu_crs : EPSG code of the land-use file. haz_crs : EPSG code of the hazard file. resolution : Desired resolution of the raster file. hazard_col : Name of the column in the hazard file that contains the hazard intensity.
- Returns:
hazard : DataSet with hazard intensity per grid cell.
landuse : DataSet with land-use information per grid cell.
- damagescanner.vector.remove_overlap_openstreetmap(gdf)[source]
Function to remove overlap in polygons in from OpenStreetMap.
- Arguments:
gdf : a geopandas GeoDataFrame with all unique railway linestrings.
- Returns:
GeoDataFrame : a geopandas GeoDataFrame with (almost) non-overlapping polygons.
- damagescanner.vector.extract_value_other_gdf(x, gdf, col_name)[source]
Function to extract value from column from other GeoDataFrame
- Arguments:
x : row of main GeoDataFrame.
gdf : geopandas GeoDataFrame from which we want to extract values.
col_name : the column name from which we want to get the value.
- damagescanner.vector.reproject(df_ds, current_crs='epsg:4326', approximate_crs='epsg:3035')[source]
Function to reproject a GeoDataFrame to a different CRS.
- Args:
df_ds (pandas DataFrame): _description_ current_crs (str, optional): _description_. Defaults to “epsg:4326”. approximate_crs (str, optional): _description_. Defaults to “epsg:3035”.
- Returns:
_type_: _description_
- damagescanner.vector.get_damage_per_object(obj, df_ds, objects, curves, maxdam)[source]
” Function to calculate the damage per object.
- Args:
obj (tuple): The object for which we want to calculate the damage. df_ds (pandas DataFrame): The dataframe with the hazard points. objects (pandas DataFrame): The dataframe with the objects. curves (pandas DataFrame): The dataframe with the vulnerability curves. maxdam (dictionary): The dictionary with the maximum damage per object type.
- Returns:
tuple: The damage per object.