GetCDLImage {CropScapeR} | R Documentation |
Request images of the CDL data
Description
A function that requests images of the CDL data for an area of interests in a given year from the CropScape. This function implements the GetCDLImage service provided by the CropScape https://nassgeodata.gmu.edu/CropScape.
Usage
GetCDLImage(
aoi = NULL,
year = NULL,
type = NULL,
format = "png",
crs = NULL,
destfile = NULL,
verbose = TRUE,
tol_time = 20
)
Arguments
aoi |
Area of interest. Can be a 5-digit FIPS code of a county, 2-digit FIPS code of a state, four corner points or an sf object that defines a rectangle (or a box) area, multiple coordinates that defines a polygon, or a URL of an compressed ESRI shapefile. |
year |
Year of data. Should be a 4-digit numeric value. |
type |
Type of the selected AOI. 'f' for state or county, 'b' for box area, 'ps' for polygon, 's' for ESRI shapefile. |
format |
Format of the image file. Can be png or kml. |
crs |
Coordinate system. |
destfile |
A character string that specifies the directory to save the downloaded image file (e.g., 'C:/image.png'). Note that
the name of the image file should be specified as well. If not providing |
verbose |
|
tol_time |
Number of seconds to wait for a response until giving up. Default is 20 seconds. |
Details
The usage of this function is similar to the GetCDLData
function. Please see the help page of the GetCDLData
function
for details. Note that the aoi
cannot be a single point here.
Value
The function downloads an image file in png or kml format to users' computer. This function is different to GetCDLData
that returns a raster TIF file.