arc_raster {arcgislayers}R Documentation

Read from an Image Server

Description

Given an ImageServer export an image as a terra SpatRaster object. See terra::rast.

Usage

arc_raster(
  x,
  xmin,
  xmax,
  ymin,
  ymax,
  bbox_crs = NULL,
  crs = sf::st_crs(x),
  width = NULL,
  height = NULL,
  format = "tiff",
  token = arc_token()
)

Arguments

x

an ImageServer as created with arc_open().

xmin

the minimum bounding longitude value.

xmax

the maximum bounding longitude value.

ymin

that minimum bounding latitude value.

ymax

the maximum bounding latitude value.

bbox_crs

the CRS of the values passed to xmin, xmax, ymin, and ymax. If not specified, uses the CRS of x.

crs

the CRS of the resultant raster image and the provided bounding box defined by xmin, xmax, ymin, ymax (passed outSR query parameter).

width

default NULL. Cannot exceed x[["maxImageWidth"]].

height

default NULL. Cannot exceed x[["maxImageHeight"]].

format

default "tiff". Must be one of "jpgpng", "png", "png8", "png24", "jpg", "bmp", "gif", "tiff", "png32", "bip", "bsq", "lerc".

token

default arc_token() authorization token.

Details

[Experimental]

Value

An object of class SpatRaster.

Examples

## Not run: 
img_url <- "https://landsat2.arcgis.com/arcgis/rest/services/Landsat/MS/ImageServer"

landsat <- arc_open(img_url)

arc_raster(
  landsat,
  xmin = -71,
  ymin = 43,
  xmax = -67,
  ymax = 47.5,
  bbox_crs = 4326,
  width = 100,
  height = 100
)

## End(Not run)


[Package arcgislayers version 0.3.0 Index]