Formats an sf shapefile to a formatted geojson

sf_to_geojson(sf_shape, endpoint = "raster")

Arguments

sf_shape

The sf shapefile to transform

endpoint

The GFW endpoint destination for the geojson ("raster" or "event")

Value

A correctly-formatted geojson to be used in get_raster() or get_event()

Examples

library(gfwr)
data(test_shape)
substr(sf_to_geojson(test_shape), 1, 20)
#> [1] "{\"geojson\":{\"type\":\""
substr(sf_to_geojson(test_shape, endpoint = "event"), 1, 20)
#> [1] "\"geometry\":{\"type\":\""