knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE )
The following geojson
classes are suppported:
class name - (geojson
package class name)
GeometryCollection
- (geometrycollection
)FeatureCollection
- (featurecollection
)Feature
- (feature
)Point
- (point
)MultiPoint
- (multipoint
)Polygon
- (polygon
)MultiPolygon
- (multipolygon
)LineString
- (linestring
)MultiLineString
- (multilinestring
)You can create these classes with functions in geojson
, e.g., create a point class like
x <- "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-99.74,32.45]},\"properties\":{}}]}" gj_point(x)
x <- '{ "type": "GeometryCollection", "geometries": [ { "type": "Point", "coordinates": [100.0, 0.0] }, { "type": "LineString", "coordinates": [ [101.0, 0.0], [102.0, 1.0] ] } ] }' as.geojson(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.