Nothing
## ----echo=FALSE---------------------------------------------------------------
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
warning = FALSE,
message = FALSE
)
## ----eval=FALSE---------------------------------------------------------------
# install.packages("geoops")
## ----eval=FALSE---------------------------------------------------------------
# remotes::install_github("ropensci/geoops")
## -----------------------------------------------------------------------------
library("geoops")
## -----------------------------------------------------------------------------
geoops::version()
## -----------------------------------------------------------------------------
pt1 <- '{
"type": "Feature",
"properties": {
"marker-color": "#f00"
},
"geometry": {
"type": "Point",
"coordinates": [-75.343, 39.984]
}
}'
#'
pt2 <- '{
"type": "Feature",
"properties": {
"marker-color": "#0f0"
},
"geometry": {
"type": "Point",
"coordinates": [-75.534, 39.123]
}
}'
## -----------------------------------------------------------------------------
geo_distance(pt1, pt2)
## -----------------------------------------------------------------------------
geo_bearing(pt1, pt2)
## -----------------------------------------------------------------------------
geo_destination(pt1, 50, 90, 'miles')
## -----------------------------------------------------------------------------
line <- '{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[-77.031669, 38.878605],
[-77.029609, 38.881946],
[-77.020339, 38.884084],
[-77.025661, 38.885821],
[-77.021884, 38.889563],
[-77.019824, 38.892368]
]
}
}'
geo_line_distance(line, units = "kilometers")
## -----------------------------------------------------------------------------
point1 <- '{
"type": "Feature",
"properties": {
"marker-color": "#0f0"
},
"geometry": {
"type": "Point",
"coordinates": [28.965797, 41.010086]
}
}'
#'
points <- '{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [28.973865, 41.011122]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [28.948459, 41.024204]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [28.938674, 41.013324]
}
}
]
}'
geo_nearest(point1, points)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.