Learn R Programming

lawn (version 0.1.7)

lawn_tag: Spatial join of points and polygons

Description

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

Usage

lawn_tag(points, polygons, poly_id, containing_polyid, lint = FALSE)

Arguments

points
poly_id
property in polygons to add to joined Point features
containing_polyid
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

See Also

Other joins: lawn_inside, lawn_within

Examples

Run this code
pts <- lawn_random(n = 30)
polys <- lawn_triangle_grid(c(-77.3876, 38.7198, -76.9482, 39.0277), 30, 'miles')
polys$features$properties <-
   data.frame(fill = c("#f92", "295"), stroke = 1:2, `fill-opacity` = 2:3)
lawn_tag(pts, polys, 'fill', 'marker-color')

Run the code above in your browser using DataLab