Description Usage Arguments See Also Examples
Create a Feature
1 | lawn_feature(geometry, properties = c(), lint = FALSE)
|
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: |
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()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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)
|
<Feature>
Type: Point
Bounding box: -75.3 40.0 -75.3 40.0
No. points: 2
Properties: NULL
<Feature>
Type: Point
Bounding box: -75.3 40.0 -75.3 40.0
No. points: 2
Properties:
foo: bar
[[1]]
<Feature>
Type: Point
Bounding box: -75.3 40.0 -75.3 40.0
No. points: 2
Properties: NULL
[[2]]
<Feature>
Type: Point
Bounding box: -75.8 39.3 -75.8 39.3
No. points: 2
Properties: NULL
[[3]]
<Feature>
Type: Point
Bounding box: -75.5 39.1 -75.5 39.1
No. points: 2
Properties: NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.