geojson_api: Send to API

View source: R/send_geojson_to_api.R

geojson_apiR Documentation

Send to API

Description

Function that take JSON from the API and convert into R format

Usage

geojson_api(
  path,
  url = "https://dev.carbon.place/api/v1/locations.json?geojson=",
  showinput = TRUE,
  path_dem = paste0(.libPaths()[1], "/sdca/exdata/UKdem.tif"),
  path_landcover = paste0(.libPaths()[1], "/sdca/exdata/landcover.tif"),
  path_bedrock = paste0(.libPaths()[1], "/sdca/exdata/bedrock.tif"),
  path_superficial = paste0(.libPaths()[1], "/sdca/exdata/superficial.tif")
)

Arguments

path

path to geojson downloaded from website

url

API url

showinput

logical, if TRUE input to R package is returned else resutls are returned

path_dem

path to the terrain raster, defaults to location set by 'download_rasters()'

path_landcover

path to the land cover raster, defaults to location set by 'download_rasters()'

path_bedrock

path to the bedrock raster, defaults to location set by 'download_rasters()'

path_superficial

path to the superficial raster, defaults to location set by 'download_rasters()'

Value

a named list of data frames and other objects

Examples

## Not run: 
parse_json("jsonhere")

## End(Not run)

SDCA-tool/sdca-package documentation built on Aug. 13, 2022, 5:41 p.m.