Title: | Access to Quantarctica Data Sets |
---|---|
Description: | Quantarctica is a collection of Antarctic geographical datasets which works with the free, cross-platform, open-source software QGIS. It includes community-contributed, peer-reviewed data from ten different scientific themes and a professionally-designed basemap. This package provides access to Quantarctica data sets. |
Authors: | Kim Fitter [aut], Charlène Guillaumot [aut], David Ranzolin [aut], Marc Desgroseilliers [aut], Ben Raymond [aut, cre] |
Maintainer: | Ben Raymond <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.3 |
Built: | 2024-11-03 03:21:01 UTC |
Source: | https://github.com/SCAR/quantarcticR |
The cache directory is used to store data locally, so that they can be used offline later. If called with no arguments (i.e. qa_cache_dir()
), this function returns the current cache directory. By default, this is a per-session temporary directory. Calling with a path
argument will set the cache directory to that path.
qa_cache_dir(path, verbose = FALSE)
qa_cache_dir(path, verbose = FALSE)
path |
string: (optional) Values can be "session" (a per-session temporary directory will be used, default), "persistent" (the directory returned by |
verbose |
logical: show progress messages? |
The path to the cache directory
## return the current cache directory qa_cache_dir() ## set the cache directory to a location that persists across ## user sessions qa_cache_dir("persistent") ## switch to a per-session cache qa_cache_dir("session")
## return the current cache directory qa_cache_dir() ## set the cache directory to a location that persists across ## user sessions qa_cache_dir("persistent") ## switch to a per-session cache qa_cache_dir("session")
Retrieve details of a Quantarctica data set
qa_dataset( name, cache_directory = qa_cache_dir(), refresh_cache = 0, verbose = FALSE )
qa_dataset( name, cache_directory = qa_cache_dir(), refresh_cache = 0, verbose = FALSE )
name |
string: the name of the data set |
cache_directory |
string: the cache directory to use. As for the |
refresh_cache |
numeric: 0 = do not overwrite existing files, 1 = overwrite if the remote file is newer than the local copy, 2 = always overwrite existing files |
verbose |
logical: show progress messages? |
A tibble
## Not run: dsx <- qa_dataset("ALBMAP Bed/bathymetry elevation (5km)") ## End(Not run)
## Not run: dsx <- qa_dataset("ALBMAP Bed/bathymetry elevation (5km)") ## End(Not run)
Available Quantarctica data sets
qa_datasets( cache_directory = qa_cache_dir(), refresh_cache = 0, verbose = FALSE )
qa_datasets( cache_directory = qa_cache_dir(), refresh_cache = 0, verbose = FALSE )
cache_directory |
string: the cache directory to use. As for the |
refresh_cache |
numeric: as for |
verbose |
logical: show progress messages? |
A tibble with columns layername
, main_file
, type
, cached
, and download_size
## Not run: qa_datasets() ## End(Not run)
## Not run: qa_datasets() ## End(Not run)
Fetch a Quantarctica data set
qa_get( dataset, cache_directory = qa_cache_dir(), refresh_cache = 0, verbose = FALSE, shapefile_reader, raster_reader )
qa_get( dataset, cache_directory = qa_cache_dir(), refresh_cache = 0, verbose = FALSE, shapefile_reader, raster_reader )
dataset |
string or qa_dataset: the name of the data set or a data set object as returned by |
cache_directory |
string: the cache directory to use. As for the |
refresh_cache |
numeric: 0 = do not overwrite existing files, 1 = overwrite if the remote file is newer than the local copy, 2 = always overwrite existing files |
verbose |
logical: show progress messages? |
shapefile_reader |
function: function to use to read shapefiles. By default this is |
raster_reader |
function: function to use to read raster files (TIFF, JP2, VRT). By default this is |
By default, an object of class SpatialPolygonsDataFrame (for shapefile layers) or RasterLayer (for raster layers). Objects of other classes may be returned if non-default shapefile_reader
or raster_reader
functions are used
Has a dataset been downloaded to the local cache?
qa_is_cached(dataset, cache_directory = qa_cache_dir(), verbose = FALSE)
qa_is_cached(dataset, cache_directory = qa_cache_dir(), verbose = FALSE)
dataset |
string or qa_dataset: the dataset object, or name of the dataset |
cache_directory |
string: the cache directory to check. As for the |
verbose |
logical: show progress messages? |
Logical
## Not run: ds <- qa_dataset("ADD Simple basemap") qa_is_cached(ds) ## FALSE x <- qa_get(ds) qa_is_cached(ds) ## TRUE ## End(Not run)
## Not run: ds <- qa_dataset("ADD Simple basemap") qa_is_cached(ds) ## FALSE x <- qa_get(ds) qa_is_cached(ds) ## TRUE ## End(Not run)
Get or set the Quantarctica download mirror site to use
qa_mirror(mirror)
qa_mirror(mirror)
mirror |
string: the URL of the mirror to use |
If called with no arguments, the current mirror URL will be returned as a string. If called with a mirror
argument, the mirror will be set to that and then the mirror URL returned.
## current mirror qa_mirror() ## all available mirrors qa_mirrors() ## set to first mirror in that list qa_mirror(qa_mirrors()$url[1]) ## or equivalently qa_mirror(qa_mirrors()[1, ])
## current mirror qa_mirror() ## all available mirrors qa_mirrors() ## set to first mirror in that list qa_mirror(qa_mirrors()$url[1]) ## or equivalently qa_mirror(qa_mirrors()[1, ])
Choose the mirror closest to you for the fastest and most reliable download.
qa_mirrors()
qa_mirrors()
A tibble with columns country
, protocol
, and url
http://quantarctica.npolar.no/downloads/
qa_mirrors()
qa_mirrors()