Title: | Create an 'Area of Interest' Around a Constructed Dam for Comparative Impact Evaluations |
---|---|
Description: | Define a spatial 'Area of Interest' (AOI) around a constructed dam using hydrology data. Dams have environmental and social impacts, both positive and negative. Current analyses of dams have no consistent way to specify at what spatial extent we should evaluate these impacts. 'damAOI' implements methods to adjust reservoir polygons to match satellite-observed surface water areas, plot upstream and downstream rivers using elevation data and accumulated river flow, and draw buffers clipped by river basins around reservoirs and relevant rivers. This helps to consistently determine the areas which could be impacted by dam construction, facilitating comparative analysis and informed infrastructure investments. |
Authors: | Chris Littleboy [aut, cre] , Isabel Jones [ctb, fnd] |
Maintainer: | Chris Littleboy <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0 |
Built: | 2024-11-10 03:30:25 UTC |
Source: | https://github.com/chrislittleboy/damaoi |
adjust polygon of reservoir to reference surface water extent map
adjustreservoirpolygon( reservoir, water_bodies, dem, poss_expand = 20000, wbjc = 0 )
adjustreservoirpolygon( reservoir, water_bodies, dem, poss_expand = 20000, wbjc = 0 )
reservoir |
An sf polygon, with an unstandardised raw reservoir |
water_bodies |
A rast, where 1 indicates water, NA otherwise |
dem |
A rast, showing elevation |
poss_expand |
A number, indicating the number of meters away from the raw reservoir the reservoir may expand to. Default is 20000 (20km). |
wbjc |
A number indicating a "water body join correction". This is a small buffer zone for the reservoir polygon to ensure that it is contiguous (important where there are small channels connecting different parts of the same water body). Default is 0 but it is necessary for some dams to include a small buffer, particularly if the reservoir has areas which are less wide than the resolution of the underlying DEM. |
An sf polygon with an adjusted reservoir polygon
autogetpourpoints
autogetpourpoints(reservoir, fac)
autogetpourpoints(reservoir, fac)
reservoir |
An sf polygon, with an unstandardised raw reservoir |
fac |
A rast, showing accumulated water flow along river |
An sf multipoint where rivers flow into and out of the reservoir
Buffers the reservoir and the river, and clips to basin areas
basinandbuffers( reservoir, upstream, downstream, basins, streambuffersize, reservoirbuffersize )
basinandbuffers( reservoir, upstream, downstream, basins, streambuffersize, reservoirbuffersize )
reservoir |
An sf polygon, with a reservoir |
upstream |
An sf line, following the river upstream of the reservoir |
downstream |
An sf line, following the river downstream of the reservoir |
basins |
An sf multipolygon, with the basins in the area around the dam |
streambuffersize |
A number indicating the distance around the upstream and downstream river to consider as impacted. Defaults to 2000 (2km). |
reservoirbuffersize |
A number indicating the distance around the reserviur to consider as impacted. Defaults to 5000 (5km) |
A two element list. Element 1 is an sf multipolygon with the reservoir buffer, upstream and downstream areas. Element 2 is the same, but clipped to river basin polygons.
Polygon for river basins around alquva dam
basins_tehri
basins_tehri
An sf polygon
HydroBasins
Performs 1) standardisation of reservoir extent, 2) calculation of river course upstream and downstream and 3) clipping to river basins
getimpactedarea( reservoir, water_bodies = NULL, dem, fac, basins, pourpoints, toprocess = TRUE, espg = 4326, toadjust = FALSE, poss_expand = 20000, river_distance = 1e+05, nn = 100, ac_tolerance = 2, e_tolerance = 5, streambuffersize = 2000, reservoirbuffersize = 5000, wbjc = 0 )
getimpactedarea( reservoir, water_bodies = NULL, dem, fac, basins, pourpoints, toprocess = TRUE, espg = 4326, toadjust = FALSE, poss_expand = 20000, river_distance = 1e+05, nn = 100, ac_tolerance = 2, e_tolerance = 5, streambuffersize = 2000, reservoirbuffersize = 5000, wbjc = 0 )
reservoir |
An sf polygon, with an unstandardised raw reservoir |
water_bodies |
A rast, where 1 indicates water, NA otherwise. Required if toadjust == TRUE. |
dem |
A rast, showing elevation |
fac |
A rast, showing accumulated water flow along river |
basins |
An sf multipolygon, with the basins in the area around the dam |
pourpoints |
An sf multipoint, showing the points where rivers flow in and out of reservoirs |
toprocess |
Whether to reprocess input data from 4326 to UTM (the default for consistency) |
espg |
In case processing to UTM or other CRS has been done (not making use of preprocessing) the espg code to include |
toadjust |
A true/false parameter whether to adjust the reservoir to surrounding water bodies |
poss_expand |
A number, indicating the number of meters away from the raw reservoir the reservoir may expand to. Default is 20000 (20km). |
river_distance |
A number, indicating the number of meters downstream and upstream for the area of interest. Defaults to 100000 (100km) |
nn |
A number, indicating the number of nearest neighbours to consider in the algorithm to determine river course. Higher can be more accurate but is slower. Default 100. |
ac_tolerance |
A number, indicating the tolerance to changes in flow accumulation. Default 2, which means that if accumulated flow changes by a factor of 2 (halved or doubled) the area of interest should not include any further downstream or upstream. This is to account for confluences. |
e_tolerance |
A number indicating the tolerance to changes in elevation. Rivers flow downstream. But DEMs can show downstream areas of the river as higher, due to averaging nearby pixels. This is particularly true when rivers run through gorges. If there is no downstream lower river poitn nearby, the elevation tolerance allows the algorithm to select a point at a higher elevation, up to the threshold defined here. |
streambuffersize |
A number indicating the distance around the upstream and downstream river to consider as impacted. Defaults to 2000 (2km). |
reservoirbuffersize |
A number indicating the distance around the reserviur to consider as impacted. Defaults to 5000 (5km) |
wbjc |
A number, the water body join correction. This indicates the buffer zone for the reservoir, to ensure that it is contiguous (important where there are small channels connecting different parts of the same water body). Default is 0, but is necessary for some dams depending on the context. |
An sf multipolygon with the reservoir buffer, upstream and downstream areas
Calculation of river points
getriverpoints( reservoir, pourpoints, ppid, river_distance, ac_tolerance, e_tolerance, nn, fac = fac, dem = dem )
getriverpoints( reservoir, pourpoints, ppid, river_distance, ac_tolerance, e_tolerance, nn, fac = fac, dem = dem )
reservoir |
An sf polygon, with an unstandardised raw reservoir |
pourpoints |
An sf multipoint, showing the points where rivers flow in and out of reservoirs |
ppid |
An integer to index through the pourpoints dataframe |
river_distance |
A number, indicating the number of meters downstream and upstream for the area of interest. Defaults to 100000 (100km) |
ac_tolerance |
A number, indicating the tolerance to changes in flow accumulation. Default 2, which means that if accumulated flow changes by a factor of 2 (halved or doubled) the area of interest should not include any further downstream or upstream. This is to account for confluences. |
e_tolerance |
A number indicating the tolerance to changes in elevation. Rivers flow downstream. But DEMs can show downstream areas of the river as higher, due to averaging nearby pixels. This is particularly true when rivers run through gorges. If there is no downstream lower river poitn nearby, the elevation tolerance allows the algorithm to select a point at a higher elevation, up to the threshold defined here. |
nn |
A number, indicating the number of nearest neighbours to consider in the algorithm to determine river course. Higher can be more accurate but is slower. Default 100. |
fac |
A rast, showing accumulated water flow along river |
dem |
A rast, showing elevation |
A three-element list, where the first element contains the data produced by the algorithm for all points along the river, and the second element is the sf LINESTRING object for the river, and the third denotes whether the river goes upstream (0) or downstream (1)
getshinyparams
getshinyparams(res)
getshinyparams(res)
res |
An sf polygon, with an unstandardised raw reservoir |
Parameters to start the shiny app for determining pour points manually for a given reservoir
makesystem
makesystem(names, aois, dem, betweenthreshold = 1, bwru = TRUE)
makesystem(names, aois, dem, betweenthreshold = 1, bwru = TRUE)
names |
The names of dams within the same system |
aois |
An sf polygon, containing all AOI areas for all dams which are part of the system |
dem |
An elevation raster covering the extent of the system. This is used to determine the uppermost and lowest dams in the system. |
betweenthreshold |
The minimum area in km2 considered significant for between areas (to avoid small adjoining polygons already mostly contained in other AOI polygons) |
bwru |
Whether the areas between a dam system (i.e. connecting rivers) are within the bounding box of the reservoirs in that system. They will mostly be, though for some dam systems rivers can travel, for example, far to the east then back again to the west to rejoin another dam in the same system. |
A set of AOI polygons for the entire system, when dams are part of a system of dams.
pointstolines
pointstolines(riverpoints, espg)
pointstolines(riverpoints, espg)
riverpoints |
list of dataframes returned by the riverpoints function. |
espg |
espg code of UTM zone |
An list of upstream lines (multilinestring) and downstream line (linestring)
preprocessing
preprocessing( reservoir, dem = NULL, fac = NULL, water_bodies = NULL, basins = NULL, pourpoints = NULL, river_distance )
preprocessing( reservoir, dem = NULL, fac = NULL, water_bodies = NULL, basins = NULL, pourpoints = NULL, river_distance )
reservoir |
An sf polygon, with an unstandardised raw reservoir |
dem |
A rast, showing elevation |
fac |
A rast, showing accumulated water flow along river |
water_bodies |
A rast, where 1 indicates water, NA otherwise |
basins |
An sf multipolygon, with the basins in the area around the dam |
pourpoints |
An sf multipoint, showing the points where rivers flow in and out of reservoirs |
river_distance |
A number, indicating the number of meters downstream and upstream for the area of interest. Defaults to 100000 (100km) |
A list with utm transformed input data
Upper and Lower Paunglaung in Myanmar.
system
system
An sf polygon
GRanD v1.3 for the reservoir polygons
This data gives the reservoir area for tehri dam in India
tehri
tehri
An sf polygon
GRanD v1.3