Learn R Programming

galah (version 1.5.4)

atlas_media: Get metadata on images, sounds and videos

Description

In addition to text data describing individual occurrences and their attributes, ALA stores images, sounds and videos associated with a given record. atlas_media displays metadata for any and all of the media types.

Usage

atlas_media(
  request = NULL,
  identify = NULL,
  filter = NULL,
  geolocate = NULL,
  data_profile = NULL,
  download_dir = NULL,
  refresh_cache = FALSE
)

Value

An object of class tbl_df and data.frame (aka a tibble) of metadata of the requested media.

Arguments

request

optional data_request object: generated by a call to galah_call().

identify

data.frame: generated by a call to galah_identify().

filter

data.frame: generated by a call to galah_filter()

geolocate

string: generated by a call to galah_geolocate()

data_profile

string: generated by a call to galah_apply_profile()

download_dir

string: path to directory where downloaded media will be stored. DEPRECATED; use collect_media() instead.

refresh_cache

logical: if set to TRUE and galah_config(caching = TRUE) then files cached from a previous query will be replaced by the current query. DEPRECATED; use collect_media() instead.

Details

atlas_media() works by first finding all occurrence records matching the filter which contain media, then downloading the metadata for the media. To actually download the files themselves, use collect_media(). It may be beneficial when requesting a large number of records to show a progress bar by setting verbose = TRUE in galah_config().

See Also

atlas_counts() to find the number of records with media; but note this is not necessarily the same as the number of media files, as each record can have more than one media file associated with it (see examples section for how to do this).

Examples

Run this code
if (FALSE) {
# Download Regent Honeyeater records with multimedia attached
galah_call() |>
  galah_identify("Regent Honeyeater") |>
  galah_filter(year == 2011) |>
  atlas_media()

# Download multimedia
galah_call() |>
  galah_identify("Regent Honeyeater") |>
  galah_filter(year == 2011) |>
  atlas_media() |>
  collect_media(path = "folder/your-directory")

# Specify a single media type to download
galah_call() |>
  galah_identify("Eolophus Roseicapilla") |>
  galah_filter(multimedia == "Sound") |>
  atlas_media()

# It's good to check how many records have media files before downloading
galah_call() |>
  galah_filter(multimedia == c("Image", "Sound", "Video")) |>
  galah_group_by(multimedia) |>
  atlas_counts()
}

Run the code above in your browser using DataLab