lawn_nearest | R Documentation |
Takes a reference data-Point and a set of points to compare it against and returns the point from the set closest to the reference
lawn_nearest(point, against, lint = FALSE)
point |
The reference point, a data-Feature<(data-Point)> |
against |
Input point set, a data-FeatureCollection |
lint |
(logical) Lint or not. Uses geojsonhint. Takes up increasing
time as the object to get linted increases in size, so probably use by
default for small objects, but not for large if you know they are good
geojson objects. Default: |
A data-Feature<(data-Point)>
point <- '{ "type": "Feature", "properties": { "marker-color": "#0f0" }, "geometry": { "type": "Point", "coordinates": [28.965797, 41.010086] } }' against <- '{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [28.973865, 41.011122] } }, { "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [28.948459, 41.024204] } }, { "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [28.938674, 41.013324] } } ] }' lawn_nearest(point, against) ## Not run: lawn_nearest(point, against) %>% view ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.