Gets the nearest point on a stream as the crow flies to the coordinates (within the tolerance).
fwa_index_point(
x,
y,
srid = 4326,
tolerance = 5000,
limit = 1,
bbox = NULL,
properties = NULL,
transform = NULL,
epsg = 4326,
nocache = getOption("fwa.nocache", FALSE)
)
A number of the x coordinate.
A number of the y coordinate.
A positive whole number of the epsg of the coordinates.
A number of the tolerance in m.
A positive whole number indicating the maximum number of features to return.
A vector of four numbers indicating bounding box to limit output
features to, e.g. c(minLon, minLat, maxLon, maxLat)
.
A vector of strings of the column names to include. If NULL (default), all columns are retained.
A character vector with the name of the valid transform function followed by the parameter values (e.g. c("ST_Simplify", 100))
A positive whole number of the epsg to transform features to.
A flag specifying whether or not to cache results.
An sf object.
To also return the second nearest point on a stream as the crow flies (within the tolerance)
set limit = 2
.
Other functions:
fwa_locate_along()
,
fwa_locate_along_interval()
,
fwa_watershed_at_measure()
,
fwa_watershed_hex()
,
fwa_watershed_stream()
,
hydroshed()
fwa_index_point(x = -132.26, y = 53.36)
#> Simple feature collection with 1 feature and 8 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: -132.2547 ymin: 53.35672 xmax: -132.2547 ymax: 53.35672
#> Geodetic CRS: WGS 84
#> # A data frame: 1 × 9
#> bc_ind blue_line_key distance_to_stream downstream_route_measure gnis_name
#> * <lgl> <int> <dbl> <dbl> <chr>
#> 1 TRUE 360824839 508. 1118. NA
#> # ℹ 4 more variables: linear_feature_id <int>, localcode_ltree <chr>,
#> # wscode_ltree <chr>, geometry <POINT [°]>