Explore an sf R object using TGVE npm package.

explore_sf(
  sf = NULL,
  background = FALSE,
  static = FALSE,
  path = tempInstance()
)

Arguments

sf

a valid sf object that can be converted to geojson

background

Boolean to decide whether plumber

static

boolean to decide whether data is written to disk and self contained application is built

path

path of a TGVE instance, defaults to one in `tempdir()` should run in the background

Value

depending on `background` either a or not blocking `plumber::pr` object is started or returned. In the case of a `backgruond` FALSE value a message is displayed with object details.

Examples

{
gj = c(
'[
      {"type":"Point","coordinates":[0,0]},
      {"type":"LineString","coordinates":[[-1,-1],[1,1]]},
        {
      "type": "FeatureCollection",
      "features": [
      {
        "type": "Feature",
        "properties": {"id":1},
        "geometry": {"type": "Point", "coordinates": [100.0, 0.0]}
      }
    ]
  }
    ]'
)
sf = geojsonsf::geojson_sf(gj)
ps = tgver::explore_sf(sf, background = TRUE)
ps$kill()
}
#> Running plumber at: http://127.0.0.1/8000
#> [1] TRUE