Skip to contents

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

Usage

atlas_media(
  request = NULL,
  identify = NULL,
  filter = NULL,
  geolocate = NULL,
  select = galah_select(group = "basic"),
  download_dir,
  refresh_cache = FALSE
)

Arguments

request

optional data_rquest 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()

select

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

download_dir

string: path to directory to store the downloaded media in

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

Value

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

Details

atlas_occurrences() works by first finding all occurrence records matching the filter which contain media, then downloading the metadata for the media and the media files. galah_filter() can take both filter relating to occurrences (e.g. basis of records), and filter relating to media (e.g. type of licence). It may be beneficial when requesting a large number of records to show a progress bar by setting verbose = TRUE in galah_config().

Examples

Download Regent Honeyeater multimedia

media_data <- galah_call() |>
    galah_identify("Regent Honeyeater") |>
    galah_filter(year == 2011) |>
    atlas_media(download_dir = "folder/your-directory")

Specify a single media type to download

media_data <- galah_call(
     galah_identify("Eolophus Roseicapilla") |>
     galah_filter(multimedia == "Sound") |>
     atlas_media()

Filter to only records with a particular licence type (DOESN'T WORK)

media_data <- galah_call()
      galah_identify("Ornithorhynchus anatinus") |>
      galah_filter(year == 2020,
        license = "http://creativecommons.org/licenses/by-nc/4.0/") |>
       atlas_media()
)

You might also want to check how many records have media files before you download them. Do this with atlas_counts()

galah_call() |>
     galah_filter(multimedia == c("Image","Sound","Video")) |>
     galah_group_by(multimedia) |>
     atlas_counts()

See also

atlas_counts() to find the number of records with media- 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).