
Create a Feature
lawn_feature(geometry, properties = c(), lint = FALSE)
(character/json) Any geojson geometry.
(list) list of properties, must be named
(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
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()
# 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)
# }
Run the code above in your browser using DataLab