feature | R Documentation |
feature class
feature(x)
x |
input |
Feature objects:
A feature object must have a member with the name "geometry". The value of the geometry member is a geometry object as defined above or a JSON null value.
A feature object must have a member with the name "properties". The value of the properties member is an object (any JSON object or a JSON null value).
If a feature has a commonly used identifier, that identifier should be included as a member of the feature object with the name "id".
# point -> feature
x <- '{ "type": "Point", "coordinates": [100.0, 0.0] }'
point(x) %>% feature()
# multipoint -> feature
x <- '{"type": "MultiPoint", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] }'
multipoint(x) %>% feature()
# linestring -> feature
x <- '{ "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] }'
linestring(x) %>% feature()
# multilinestring -> feature
x <- '{ "type": "MultiLineString",
"coordinates": [ [ [100.0, 0.0], [101.0, 1.0] ], [ [102.0, 2.0], [103.0, 3.0] ] ] }'
multilinestring(x) %>% feature()
# add to a data.frame
library('tibble')
tibble(a = 1:5, b = list(multilinestring(x)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.