Skip to contents

The function downloads data of the Hydrography90m dataset, which is split into 20°x20° tiles. If a tile ID is specified, then the selected layers (variable) will be downloaded. In addition, the Hydrography90m is organized in non-interrupted drainage basins called regional units. If a regional unit ID (reg_unit_id) is specified, then only the raster mask of the drainage basin is downloaded (useful for later processing). Multiple regular tiles, e.g. belonging to regional units, can be downloaded in a single request. The tile or regional unit IDs can be obtained using the functions "get_tile_id" and "get_regional_unit_id", respectively. The files will be stored locally in a folder architecture, similar as in the data repository, available at https://public.igb-berlin.de/index.php/s/agciopgzXjWswF4?path=%2F.

Usage

download_tiles(
  variable,
  file_format = "tif",
  tile_id = NULL,
  reg_unit_id = NULL,
  global = FALSE,
  download_dir = "."
)

Arguments

variable

character vector of variable names. See Details for all the variable names.

file_format

character. Format of the requested file ("tif" or "gpkg"). See Details.

tile_id

character vector. The IDs of the requested tiles.

reg_unit_id

character vector. The IDs of the requested regional units.

global

logical. If TRUE, the global extent file is downloaded. Default is FALSE.

download_dir

character. The directory where the files will be downloaded. Default is the working directory.

Details

In the following table you can find all the variables included in the Hydrography90m dataset. The column "Variable" includes the variable names that should be used as an input in the parameter "variable" of the function. Likewise, the column "File format" contains the input that should be given to the "file_format" parameter. For more details and visualisations of the spatial layers, please refer to https://hydrography.org/hydrography90m/hydrography90m_layers/.

Variable typeVariable nameVariableUnitFile format
NetworkDrainage basinbasintif
NetworkDrainage basinbasingpkg
NetworkSub-catchmentsub_catchmenttif
NetworkSub-catchmentsub_catchmentgpkg
NetworkStream segmentsegmenttif
NetworkOutletoutlettif
NetworkOutletoutletgpkg
NetworkRegional unitregional_unittif
NetworkFlow directiondirectiontif
FlowFlow accumulationaccumulationkm^2tif
Stream slopeCell maximum curvatureslope_curv_max_dw_cel1/mtif
Stream slopeCell minimum curvatureslope_curv_min_dw_cel1/mtif
Stream slopeCell elevation differenceslope_elv_dw_celmtif
Stream slopeCell gradientslope_grad_dw_celtif
Stream distanceShortest distance to drainage dividestream_dist_up_nearmtif
Stream distanceLongest distance to drainage dividestream_dist_up_farthmtif
Stream distanceNearest down stream stream grid cellstream_dist_dw_nearmtif
Stream distanceOutlet grid cell in the networkoutlet_dist_dw_basinmtif
Stream distanceDown stream stream node grid celloutlet_dist_dw_scatchmtif
Stream distanceEuclidean distancestream_dist_proximitymtif
Elevation differenceShortest pathstream_diff_up_nearmtif
Elevation differenceLongest pathstream_diff_up_farthmtif
Elevation differenceNearest downstream stream pixelstream_diff_dw_nearmtif
Elevation differenceOutlet grid cell in the networkoutlet_diff_dw_basinmtif
Elevation differenceDownstream stream node grid celloutlet_diff_dw_scatchmtif
Segment propertiesSegment downstream mean gradientchannel_grad_dw_segtif
Segment propertiesSegment upstream mean gradientchannel_grad_up_segtif
Segment propertiesCell upstream gradientchannel_grad_up_celtif
Segment propertiesCell stream course curvaturechannel curv_celtif
Segment propertiesSegment downstream elevation differencechannel_elv_dw_segtif
Segment propertiesSegment upstream elevation differencechannel_elv_up_segtif
Segment propertiesCell upstream elevation differencechannel_elv_up_celtif
Segment propertiesCell downstream elevation differencechannel_elv_dw_celtif
Segment propertiesSegment downstream distancechannel_dist_dw_segtif
Segment propertiesSegment upstream distancechannel_dist_up_segtif
Segment propertiesCell upstream distancechannel_dist_up_celtif
Stream orderStrahler’s stream orderorder_strahlertif
Stream orderShreve’s stream magnitudeorder_shrevetif
Stream orderHorton’s stream orderorder_hortontif
Stream orderHack’s stream orderorder_hacktif
Stream orderTopological dimension of streamsorder_topotif
Stream orderStrahler’s stream orderorder_vect_segmentgpkg
Stream orderShreve’s stream magnitudeorder_vect_segmentgpkg
Stream orderHorton’s stream orderorder_vect_segmentgpkg
Stream orderHack’s stream orderorder_vect_segmentgpkg
Stream orderTopological dimension of streamsorder_vect_segmentgpkg
Stream reachLength of the stream reachorder_vect_segmentmgpkg
Stream reachStraight lengthorder_vect_segmentmgpkg
Stream reachSinusoid of the stream reachorder_vect_segmentgpkg
Stream reachAccumulated lengthorder_vect_segmentmgpkg
Stream reachFlow accumulationorder_vect_segmentkm^2gpkg
Stream reachDistance to outletorder_vect_segmentmgpkg
Stream reachSource elevationorder_vect_segmentmgpkg
Stream reachOutlet elevationorder_vect_segmentmgpkg
Stream reachElevation droporder_vect_segmentgpkg
Stream reachOutlet droporder_vect_segmentgpkg
Stream reachGradientorder_vect_segmentgpkg
Flow indexStream power indexspitif
Flow indexSediment transportation indexstitif
Flow indexCompound topographic indexctitif

Note

If there is an error during the download of a file (more likely in case of files bigger than 3-4GB), you can try to manually download this file by pasting the link that is returned by the error message in your browser.

References

Amatulli G., Garcia Marquez J., Sethi T., Kiesel J., Grigoropoulou A., Üblacker M., Shen L. & Domisch S. (2022-08-09 ) Hydrography90m: A new high-resolution global hydrographic dataset. IGB Leibniz-Institute of Freshwater Ecology and Inland Fisheries. dataset. https://doi.org/10.18728/igb-fred-762.1

Author

Afroditi Grigoropoulou

Examples

# Download data for two variables in three regular tiles
# to the current working directory
download_tiles(variable = c("sti", "stream_dist_up_farth"),
               file_format = "tif",
               tile_id = c("h00v02","h16v02", "h16v04"))

# Download the global .tif layer for the variable "direction"
# into the temporary R folder or define a different directory
# Define directory
my_directory <- tempdir()
# Download layer
download_tiles(variable = "direction",
               file_format = "tif",
               global = TRUE,
               download_dir = my_directory)

# Download the raster mask of two regional units
# to the current working directory.
download_tiles(variable = "regional_unit",
               file_format = "tif",
               reg_unit_id = c("33","34"))

# Download the raster mask of all regional units
# to the current working directory.
download_tiles(variable = "regional_unit",
               file_format = "tif",
               global = TRUE)