powered by
This function calls the ESRI ArcGIS API to retrieve map imagery to overlay a rayshader map object. It requires a functioning internet connection to obtain the data.
get_image_overlay( bbox, overlay = c("World_Imagery", "NatGeo_World_Map", "USA_Topo_Maps", "World_Physical_Map", "World_Shaded_Relief", "World_Street_Map", "World_Terrain_Base", "World_Topo_Map"), img.width = 600, img.height = 600, lat = NULL, lng = NULL, save.png = FALSE, png.filename = NULL, sr_bbox = 4326, sr_image = 4326 )
The bounding box for your image.
One of the available overlays from https://services.arcgisonline.com/ArcGIS/rest/services.
Image width, in pixels
Image height, in pixels
A quoted string indicating what named value in the bounding box represents latitude. If NULL, will be inferred from bounding box names.
A quoted string indicating what named value in the bounding box represents longitude. If NULL, will be inferred from bounding box names.
Logical -- should the overlay image be saved?
Filename for the overlay if save.png is TRUE.
save.png
Spatial reference code (ISO 19111) for bounding box.
Spatial reference code (ISO 19111) for image.
A matrix object provided by readPNG, suitable for use with rayshader and similar mapping utilities. Returned invisibly.
readPNG
rayshader
# NOT RUN { bbox <- get_centroid_bounding_box(c( "lat" = 44.121268, "lng" = -73.903734 ), distance = 10 ) get_image_overlay(bbox, overlay = "World_Imagery") # } # NOT RUN { # }
Run the code above in your browser using DataLab