Description Usage Arguments Details Value See Also Examples
View source: R/osm_cleaning_functions.R
Fast search for the nearest lines to a set of points
1 |
point |
a SF data frame of POINTS with projected CRS |
lines |
a SF data frame of lines with projected CRS |
k |
integer how many lines to search |
ncores |
integer how many cores to use in parallel processing, default = 1 |
The nearest line to a point is a non-trivial calculation which in
theory requires checking the distance to every possible line. This function
takes a shortcut by measuring distances to the centroids of lines, and then
cross checking only nearby lines. The number of lines checked is defined by
k
. This process cannot guarantee 100% accuracy by is many orders of
magnitude faster. To increase accuracy increase k
.
Returns an list of ids and distances
Other OSM:
cluster_junction()
,
line_segment_sf()
,
nn_point()
,
osm_consolidate()
,
osm_get_junctions()
,
osm_main_roads()
1 2 3 4 | ## Not run:
crash_road_nn = nn_line(crash_road, osm, ncores = 5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.