download_searchindex {photon} | R Documentation |
Download search index
Description
Finds and downloads the Elasticsearch index database necessary to set up Photon locally.
Usage
download_searchindex(
path = ".",
country = "Monaco",
date = "latest",
exact = FALSE,
section = NULL,
only_url = FALSE,
quiet = FALSE
)
Arguments
path |
Path to a directory where the identified file should be stored. |
country |
Character string that can be identified by
|
date |
Character string or date-time object used to specify the creation
date of the search index. If |
exact |
If |
section |
Subdirectory of the download server from which to select a
search index. If |
only_url |
If |
quiet |
If |
Value
If only_url = FALSE
, returns the local path to the downloaded
file. Otherwise, returns the URL to the remote file.
Note
Depending on the country, search index databases tend to be very large. The global search index is about 75 GB of size (10/2024). Keep that in mind when running this function.
Examples
# 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!
## Not run:
download_searchindex(path = tempdir(), country = "planet")
## End(Not run)