new_photon {photon} | R Documentation |
Initialize a photon instance by creating a new photon object. This object is stored in the R session and can be used to perform geocoding requests.
Instances can either local or remote. Remote instances require nothing more
than a URL that geocoding requests are sent to. Local instances require the
setup of the photon executable, a search index, and Java. See
photon_local
for details.
new_photon(
path = NULL,
url = NULL,
photon_version = NULL,
country = NULL,
date = "latest",
exact = FALSE,
section = NULL,
opensearch = FALSE,
overwrite = FALSE,
quiet = FALSE
)
path |
Path to a directory where the photon executable and data
should be stored. Defaults to a directory "photon" in the current
working directory. If |
url |
URL of a photon server to connect to. If |
photon_version |
Version of photon to be used. A list of all
releases can be found here: https://github.com/komoot/photon/releases/.
Ignored if |
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 |
opensearch |
If |
overwrite |
If |
quiet |
If |
An R6 object of class photon
.
# connect to public API
photon <- new_photon()
# connect to arbitrary server
photon <- new_photon(url = "photonserver.org")
if (has_java("11")) {
# set up a local instance in the current working directory
photon <- new_photon("photon", country = "Monaco")
}