Material for the 'Working with Geospatial Hydrologic Data for Watershed Analyses in R and Python Using Web Services' ICRW8 Workshop.
For working with R, you can use RStudio and you will need the following libraries installed:
library(remotes)
library(sf)
library(lwgeom)
library(ggplot2)
library(jsonlite)
library(httr)
library(data.table)
library(dplyr)
library(readr)
library(knitr)
library(rnaturalearth)
library(stringr)
library(osmdata)
library(mapview)
library(dataRetrieval)
library(terra)
library(raster)
library(stars)
library(remotes)
library(elevatr)
remotes::install_github("mhweber/awra2020spatial")
library(awra2020spatial)
remotes::install_github("mhweber/Rspatialworkshop")
library(Rspatialworkshop)
remotes::install_github("mikejohnson51/AOI")
#hydroloom
remotes::install_github("DOI-USGS/nhdplusTools@2cb81da"
library(hydroloom)
library(AOI)
library(terrainr)
#StreamCatTools
remotes::install_github("USEPA/StreamCatTools")
library(StreamCatTools)
#nwmTools
remotes::install_github("mikejohnson51/nwmTools")
library(nwmTools)
library(cowplot)
# zonal
# remotes::install_github("NOAA-OWP/zonal")
library(zonal)
For running Python notebooks you can use a combination of Miniforge or Mambaforge and Jupyter Lab or other IDE.
After installingminiforge
or mambaforge
you can create a Python environment as follows:
git clone https://github.com/mhweber/ICRW8_Geospatial_Workshop && \
cd ICRW8_Geospatial_Workshop && \
conda env create -f environment.yml
or
git clone https://github.com/mhweber/ICRW8_Geospatial_Workshop && \
cd ICRW8_Geospatial_Workshop && \
mamba env create -f environment.yml
Now a new environment called icrw8
is created that can be loaded from your IDE.
You can also use the Binder service by clicking on the Binder badge above to launch a Jupyter Lab instance with all the required Python libraries installed.
Here is a list of some useful geospatial tools and resources:
numba
and provides an easy-to-install, easy-to-extend codebase for raster analysis.