Learn R Programming

hydrolinks (version 0.10.0)

get_shape_by_id: Link IDs to warterbody shapefiles

Description

Get shapefiles containing waterbodies with specified IDs. If one argument is provided, no other arguments will be used to filter. Arguments are checked in order: PERMANENT_match, GNIS_ID_match, GNIS_NAME_match, REACHCODE_match.

Usage

get_shape_by_id(match_id, feature_type = c("flowline", "waterbody"),
  dataset = c("nhdh", "nhdplusv2", "hydrolakes"), match_column)

Arguments

match_id

ids of features to be matched.

feature_type

name of feature layer to match. The hydrolakes dataset does not include a flowline layer.

dataset

name of dataset to use for matching.

match_column

index containing match ids. Defaults to dataset ID column. Columns indexed by dataset:

nhdh nhdplusv2 hydrolakes
PERMANENT_ COMID Hylak_id
GNIS_ID GNIS_ID Lake_name
GNIS_NAME GNIS_NAME nhdh

Value

simple features object containing polygons with associated IDs.

Examples

Run this code
# NOT RUN {
library(sf)
shp = get_shape_by_id('143249470', feature_type = 'waterbody', dataset='nhdh')
plot(st_geometry(shp), col='blue')

# }

Run the code above in your browser using DataLab