On occasion, the get_flowline_index function returns an incorrect COMID assignment (and therefore an erroneous REACH_meas value) for coordinates that are clearly in a nearby COMID and on or near the NHD flowline. Below is a reproducible example that returns COMID 23809098 & REACH_meas 52.7, putting the site just downstream of the North Fork Dam on the Clackamas River in Oregon. However, these coordinates are actually just upstream of the dam in COMID 23809100 (REACH_meas ~0-10).
nhdplusTools::get_flowline_index('download_nhdplusv2', sf::st_sfc(sf::st_point(c(-122.278972,45.243732)), crs=4326))
On occasion, the get_flowline_index function returns an incorrect COMID assignment (and therefore an erroneous REACH_meas value) for coordinates that are clearly in a nearby COMID and on or near the NHD flowline. Below is a reproducible example that returns COMID 23809098 & REACH_meas 52.7, putting the site just downstream of the North Fork Dam on the Clackamas River in Oregon. However, these coordinates are actually just upstream of the dam in COMID 23809100 (REACH_meas ~0-10).
nhdplusTools::get_flowline_index('download_nhdplusv2', sf::st_sfc(sf::st_point(c(-122.278972,45.243732)), crs=4326))