photo_search: Search for photo metadata

Description Usage Arguments Details Value See Also Examples

View source: R/photo_search.R

Description

Returns image metadata for photos matching the search terms.

Usage

1
2
3
4
photo_search(mindate_taken = NULL, maxdate_taken = NULL,
  mindate_uploaded = NULL, maxdate_uploaded = NULL, user_id = NULL,
  text = NULL, tags = NULL, tags_any = TRUE, bbox = NULL,
  woe_id = NULL, sf_layer = NULL, has_geo = TRUE)

Arguments

mindate_taken

Character, or date required. Minimum taken date. Photos with an taken date greater than or equal to this value will be returned. The date should be in the form of "YYYY-MM-DD".

maxdate_taken

Character, or date required. Maximum taken date. Photos with an taken date less than or equal to this value will be returned. The date should be in the form of "YYYY-MM-DD".

mindate_uploaded

Character or date, optional. Minimum upload date. Photos with an upload date greater than or equal to this value will be returned. The date can be in the form of a unix timestamp or mysql datetime.

maxdate_uploaded

Character or date, optional. Maximum upload date. Photos with an upload date less than or equal to this value will be returned. The date can be in the form of a unix timestamp or mysql datetime.

user_id

Character, optional. The Flickr ID of the user who's photo to search. If this parameter isn't passed then everybody's public photos will be searched.

text

Character, optional. A free text search. Photos who's title, description or tags contain the text will be returned. You can exclude results that match a term by prepending it with a - character. Free text searches for words in order provided, for example a search for "climbing rock" will be different to "rock climbing".

tags

Character vector, optional. A comma-delimited list of tags. Photos with one or more of the tags listed will be returned. You can exclude results that match a term by prepending it with a - character.

tags_any

Logical, optional. If TRUE, photos containing any of the tags will be returned. If FALSE, only photos containing all tags will be returned. Defaulted to return any tags.

bbox

String, optional bounding box of search area provide as: "minimum_longitude,minimum_latitude,maximum_longitude,maximum_latitude".

woe_id

String, optional "where on earth identifier" can be supplied instead of bbox. Use find_place to obtain woe_id for a place.

sf_layer

A simple features layer, optional, area to search for photos, can be supplied instead of a bbox or woeID.

has_geo

Logical, optional parameter for whether returned photos need associated spatial data.

Details

Uses the flickr.photos.search API method from the Flickr API. This search method requires a limiting factor to prevent parameterless searches - to ensure this is met the function requires both a minimum and a maximum date that searched photographs were taken on. See https://www.flickr.com/services/api/flickr.photos.search.html for more information on the API method.

When running the function you need an API key saved as photosearcher_key.sysdata in your working directory. If this is the first function you run you will be prompted to create and enter your API key. The API key will then be saved as photosearcher_key.sysdata in your working directory and is used for all function.

Value

data.frame. Output consists of 57 variables including; latitude and longitude of photograph, date and time it was taken, associated tags and image urls.

Full list of variables returned:

See Also

Other Search for images: interesting_list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Not run: 
photo_search(
  mindate_taken = "2019-01-01",
  maxdate_taken = "2019-01-02",
  text = "tree",
  bbox = "-13.623047,47.279229,3.251953,60.630102",
  has_geo = TRUE
  )

photo_search(
  mindate_taken = "2017-01-01",
  maxdate_taken = "2017-01-02",
  mindate_uploaded = "2017-03-04",
  maxdate_uploaded = "2017-05-05",
  tags = "lake"
  )

photo_search(
  mindate_taken = "2018-01-01",
  maxdate_taken = "2018-01-03",
  tags = c("mountain", "lake"),
  tags_any = TRUE
)

photo_search(
  mindate_taken = "2018-01-01",
  maxdate_taken = "2018-01-03",
  tags = c("mountain", "lake"),
  tags_any = FALSE
)


## End(Not run)

nfox29/photosearcher documentation built on April 27, 2020, 10:34 p.m.