lawn_collect: Collect method

Description Usage Arguments Value Author(s) See Also Examples

View source: R/collect.R

Description

Given an inProperty on points and an outProperty for polygons, this finds every point that lies within each polygon, collects the inProperty values from those points, and adds them as an array to outProperty on the polygon.

Usage

1
lawn_collect(polygons, points, in_field, out_field, lint = FALSE)

Arguments

polygons

a data-FeatureCollection of data-Polygon features

points

a data-FeatureCollection of data-Point features

in_field

(character) the field in input data to analyze

out_field

(character) the field in which to store results

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

A FeatureCollection of data-Polygon features with properties listed as out_field

Author(s)

Jeff Hollister hollister.jeff@epa.gov

See Also

Other aggregations: lawn_average(), lawn_count(), lawn_deviation(), lawn_max(), lawn_median(), lawn_min(), lawn_sum(), lawn_variance()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ex_polys <- lawn_data$polygons_aggregate
ex_pts <- lawn_data$points_aggregate
res <- lawn_collect(ex_polys, ex_pts, 'population', 'stuff')
res$type
res$features
res$features$properties

## Not run: 
lawn_collect(ex_polys, ex_pts, 'population', 'stuff') %>% view

## End(Not run)

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