Learn R Programming

hydrolinks (version 0.10.0)

link_waterbody_centroids: Link geopoints to Waterbodies by centroids

Description

Link geopoints to a waterbody with the closest centroid a geospatial dataset

Usage

link_waterbody_centroids(lats, lons, ids, dataset = c("nhdh", "nhdplusv2",
  "hydrolakes"), buffer = 25)

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 "nhd" or "hydrolakes"

buffer

maximum distance between points and centroids to match

Value

Water body permanent IDs

Examples

Run this code
# NOT RUN {
centroidpt = c(33.655277, -117.834007)

#should be item ID 126859554
link_waterbody_centroids( centroidpt[1], centroidpt[2], 'dummyid', dataset='nhdh')
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab