Description Usage Arguments Examples
Convert geojson R list to JSON
1 |
x |
Output from |
pretty |
(logical) Adds indentation whitespace to JSON output. Can
be |
auto_unbox |
(logical) Automatically unbox all atomic vectors of
length 1. Default: |
... |
Further args passed on to |
1 2 3 4 | str <- "POLYGON ((100 0.1, 101.1 0.3, 101 0.5, 100 0.1),
(103.2 0.2, 104.8 0.2, 100.8 0.8, 103.2 0.2))"
as_json(wkt2geojson(str))
as_json(wkt2geojson(str), FALSE)
|
Attaching package: 'wellknown'
The following object is masked from 'package:graphics':
polygon
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
["100.0000000000000000", "0.1000000000000000"],
["101.0999999999999943", "0.3000000000000000"],
["101.0000000000000000", "0.5000000000000000"],
["100.0000000000000000", "0.1000000000000000"]
],
[
["103.2000000000000028", "0.2000000000000000"],
["104.7999999999999972", "0.2000000000000000"],
["100.7999999999999972", "0.8000000000000000"],
["103.2000000000000028", "0.2000000000000000"]
]
]
}
}
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[["100.0000000000000000","0.1000000000000000"],["101.0999999999999943","0.3000000000000000"],["101.0000000000000000","0.5000000000000000"],["100.0000000000000000","0.1000000000000000"]],[["103.2000000000000028","0.2000000000000000"],["104.7999999999999972","0.2000000000000000"],["100.7999999999999972","0.8000000000000000"],["103.2000000000000028","0.2000000000000000"]]]}}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.