| geoshape | R Documentation |
geoshape dsl
geoshape(.obj = list(), ..., field = NULL) geoshape_(.obj = list(), ..., .dots, field = NULL)
.obj |
An index object. If nothing passed defaults to all indices, equivalent to
doing e.g., |
... |
Further args passed on |
field |
Explanation... |
.dots |
Explanation... |
## Not run:
elastic::connect(errors = "complete")
## point
index("geoshape") %>%
geoshape(field = "location", type = "envelope", coordinates = list(c(-30, 50), c(30, 0))) %>%
n()
## circle and radius
index("geoshape") %>%
geoshape(field = "location", type = "circle", radius = "2000km",
coordinates = c(-10, 45)) %>%
n()
index("geoshape") %>%
geoshape(field = "location", type = "circle", radius = "5000km",
coordinates = c(-10, 45)) %>%
n()
## polygon
coords <- list(c(80.0, -20.0), c(-80.0, -20.0), c(-80.0, 60.0), c(40.0, 60.0), c(80.0, -20.0))
index("geoshape") %>%
geoshape(field = "location", type = "polygon", coordinates = coords) %>%
n()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.