lawn_tag: Spatial join of points and polygons

Description Usage Arguments Value See Also Examples

View source: R/tag.R

Description

Takes a set of data-Point's and a set of data-Polygon's and performs a spatial join.

Usage

1
lawn_tag(points, polygons, field, out_field, lint = FALSE)

Arguments

points

Input data-FeatureCollection<(data-Point)>

polygons

Input data-FeatureCollection<(data-Polygon)> or data-FeatureCollection<(data-MultiPolygon)>

field

Property in polygons to add to joined Point features.

out_field

Property in points in which to store joined property from polygons.

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: FALSE

Value

Points with containing_polyid property containing values from poly_id, as data-FeatureCollection<(data-Point)>

See Also

Other joins: lawn_inside(), lawn_within()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bbox <- c(0, 0, 10, 10)
pts <- lawn_random(n = 30, bbox = bbox)
polys <- lawn_triangle_grid(bbox, 50, 'miles')
polys$features$properties$fill <- "#f92"
polys$features$properties$stroke <- 0
polys$features$properties$`fill-opacity` <- 1
lawn_tag(pts, polys, 'fill', 'marker-color')
## Not run: 
lawn_tag(pts, polys, 'fill', 'marker-color') %>% view

## End(Not run)

lawn documentation built on Jan. 6, 2021, 5:07 p.m.