
Last chance! 50% off unlimited learning
Sale ends in
Finds and downloads the Elasticsearch index database necessary to set up Photon locally.
download_searchindex(
path = ".",
country = "Monaco",
date = "latest",
exact = FALSE,
section = NULL,
only_url = FALSE,
quiet = FALSE
)
If only_url = FALSE
, returns the local path to the downloaded
file. Otherwise, returns the URL to the remote file.
Path to a directory where the identified file should be stored.
Character string that can be identified by
countryname
as a country. An extract for this
country will be downloaded. If "planet"
, downloads a global search
index.
Character string or date-time object used to specify the creation
date of the search index. If "latest"
, will download the file tagged
with "latest". If a character string, the value should be parseable by
as.POSIXct
. If exact = FALSE
, the input value is
compared to all available dates and the closest date will be selected.
Otherwise, a file will be selected that exactly matches the input to
date
.
If TRUE
, exactly matches the date
. Otherwise,
selects the date with lowest difference to the date
parameter.
Subdirectory of the download server from which to select a
search index. If "experimental"
, selects a dump made for the master
version of photon. If "archived"
, selects a dump made for an older
version of photon. If NULL
(or any arbitrary string), selects a
dump made for the current release. Defaults to NULL
.
If TRUE
, performs a download. Otherwise,
only returns a link to the file.
If TRUE
, suppresses all informative messages.
# download the latest extract of Monaco
download_searchindex(path = tempdir())
# download the latest extract of American Samoa
download_searchindex(path = tempdir(), country = "Samoa")
# download an extract from a month ago
download_searchindex(
path = tempdir(),
country = "Monaco",
date = Sys.time() - 2629800
)
# if possible, download an extract from today
try(download_searchindex(
path = tempdir(),
country = "Monaco",
date = Sys.Date(),
exact = TRUE
))
# get the latest global coverage
# NOTE: the file to be downloaded is several tens of gigabytes of size!
if (FALSE) {
download_searchindex(path = tempdir(), country = "planet")}
Run the code above in your browser using DataLab