if (FALSE) {
# geo_list + geo_list
## Note: geo_list is the output type from geojson_list, it's just a list with
## a class attached so we know it's geojson :)
vec <- c(-99.74, 32.45)
a <- geojson_list(vec)
vecs <- list(
c(100.0, 0.0), c(101.0, 0.0), c(101.0, 1.0),
c(100.0, 1.0), c(100.0, 0.0)
)
b <- geojson_list(vecs, geometry = "polygon")
a + b
# json + json
c <- geojson_json(c(-99.74, 32.45))
vecs <- list(
c(100.0, 0.0), c(101.0, 0.0), c(101.0, 1.0),
c(100.0, 1.0), c(100.0, 0.0)
)
d <- geojson_json(vecs, geometry = "polygon")
c + d
(c + d) %>% pretty()
}
Run the code above in your browser using DataLab