Learn R Programming

hydrolinks (version 0.10.0)

link_to_waterbodies: Link geopoints to Waterbodies

Description

Link geopoints to waterbodies in a geospatial dataset. Use the point-in-polygon technique with user-selectable polygon buffer size.

Usage

link_to_waterbodies(lats, lons, ids, dataset = c("nhdh", "hydrolakes",
  "nhdplusv2"), buffer = 0)

Arguments

lats

Vector of point latitudes

lons

Vector of point longitudes

ids

Vector of point identifiers (string or numeric)

dataset

Character name of dataset to link against. Can be either "nhdh", "hydrolakes", or "nhdplusv2"

buffer

Numeric width of polygon buffer in m

Value

Water body permanent IDs

Examples

Run this code
# NOT RUN {
latlon = c(43.108728, -89.418293)
# }
# NOT RUN {
#returns linked waterbody site information for that lat/lon
link_to_waterbodies(latlon[1], latlon[2], 'id1', dataset = 'nhdh')

# }

Run the code above in your browser using DataLab