Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atlas_media returns error when filtering by license with galah_filter #151

Closed
daxkellie opened this issue Jul 14, 2022 · 2 comments
Closed
Assignees

Comments

@daxkellie
Copy link
Contributor

atlas_media returns a confusing error when trying to filter by license type

media <- galah_call() |>
  galah_identify("perameles") |>
  galah_filter(license == "CC-BY 4.0 (Int)") |>
  atlas_media(download_dir = tempdir())
#> Downloading records with media...
#> This query will return 606 records
#>   |                                                                              |                                                                      |   0%  |                                                                              |======================================================================| 100%
#> Warning: Unknown or uninitialised column: `name`.
#> Error: attempt to select less than one element in get1index

Created on 2022-07-14 by the reprex package (v2.0.1)

However, filtering by other fields work correctly

media <- galah_call() |>
  galah_identify("eolophus") |>
  galah_filter(multimedia == "Sound") |>
  atlas_media(download_dir = tempdir())
#> Downloading records with media...
#> This query will return 41 records
#>   |                                                                              |                                                                      |   0%  |                                                                              |======================================================================| 100%
#> 
#> Downloading 53 media files...
#>   |                                                                              |                                                                      |   0%  |                                                                              |======================================================================| 100%
#> 
#> 
#> 53 files were downloaded to [temp directory path]

Created on 2022-07-14 by the reprex package (v2.0.1)

@daxkellie
Copy link
Contributor Author

In addition, atlas_media uses the multimediaLicense field rather than the license field in the summary output tibble. This means that people who use atlas_counts to get record count by license will get different results to what is returned by altas_media.

It would be good to make sure the names of the column name and the field name are consistent.

@mjwestgate mjwestgate self-assigned this Jul 20, 2022
mjwestgate added a commit that referenced this issue Jul 21, 2022
Necessary lookup table for filtering by licence type, relating to issues #140 and #151
mjwestgate added a commit that referenced this issue Jul 21, 2022
`atlas_media` now returns a `tibble`, but does not download images; this allows use of e.g. `dplyr::filter` to reduce the number of images that will be returned (#140, #151)
- new function `collect_media` takes a tibble from `atlas_media` and downloads to the specified directory. Supports thumbnail downloads via `type` argument (#145)
- Alternatively, users can build their own media queries via `atlas_occurrences` and trigger a metadata download (equivalent to `atlas_media`) using `show_all_media`
@mjwestgate
Copy link
Collaborator

galah_filter no longer tries to filter media columns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants