lawn_feature: Create a Feature

View source: R/lawn_feature.R

lawn_featureR Documentation

Create a Feature

Description

Create a Feature

Usage

lawn_feature(geometry, properties = c(), lint = FALSE)

Arguments

geometry

(character/json) Any geojson geometry.

properties

(list) list of properties, must be named

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

See Also

Other data functions: lawn_featurecollection(), lawn_filter(), lawn_geometrycollection(), lawn_linestring(), lawn_multilinestring(), lawn_multipoint(), lawn_multipolygon(), lawn_point(), lawn_polygon(), lawn_random(), lawn_remove(), lawn_sample()

Examples

## Not run: 
# points
## single point
pt <- '{"type":"Point","coordinates":[-75.343,39.984]}'
lawn_feature(pt)

## with properties
lawn_feature(pt, properties = list(foo = "bar"))

## many points in a list
pts <- list(
   lawn_point(c(-75.343, 39.984))$geometry,
   lawn_point(c(-75.833, 39.284))$geometry,
   lawn_point(c(-75.534, 39.123))$geometry
)
lapply(pts, lawn_feature)

## End(Not run)

ropensci/lawn documentation built on May 18, 2022, 9:58 a.m.