get_earthtones.Rd
Download a satellite image from a selected provider, extract dominant colors, and generate an earth-tone palette.
get_earthtones(
latitude = 50.759,
longitude = -125.673,
zoom = 11,
number_of_colors = 3,
method = "pam",
sampleRate = 500,
include.map = TRUE,
provider = "Esri.WorldImagery",
...
)
Numeric. Latitude coordinate for the center of the satellite image.
Numeric. Longitude coordinate for the center of the satellite image.
Numeric. Zoom level between 0 (whole world) and 13 (high detail). Higher values zoom in closer.
Numeric. Number of dominant colors to extract.
Character. Clustering method to identify dominant colors. Options are "kmeans"
(kmeans
) or "pam"
(pam
- partitioning around medoids).
Numeric. Subsampling factor; higher values reduce computation by sampling fewer pixels.
Logical. If TRUE
, returns both the color palette and the satellite image raster. If FALSE
, returns only the color palette.
Character. Tile provider for satellite imagery. Currently supports "Esri.WorldImagery"
.
Additional arguments passed to internal functions (currently unused).
An object of class "palette"
if include.map = TRUE
, containing:
pal
: A vector of hexadecimal color codes representing the dominant colors.
map
: A raster image object of the satellite imagery.
If include.map = FALSE
, returns a vector of hexadecimal color codes.
The function retrieves satellite imagery from the specified provider, extracts colors by converting the imagery into a perceptually uniform color space, and applies a clustering algorithm to determine dominant colors. Zoom level and location significantly influence the palette generated.
if (FALSE) { # \dontrun{
# Get a palette for a location in the Bahamas
get_earthtones(latitude = 24.2, longitude = -77.88, zoom = 11, number_of_colors = 5)
# Return palette only, without map
get_earthtones(latitude = 24.2, longitude = -77.88,
zoom = 11, number_of_colors = 5, include.map = FALSE)
} # }