sl.load.naturalearth | R Documentation |
Load (read) and/or download Natural Earth data.
sl.load.naturalearth(what="all", resolution="medium", poly.split=TRUE, naturalearth.dir="~/naturalearthdata", force.download=FALSE, download.if.missing=TRUE, download.baseurl="https://www.naturalearthdata.com/http//www.naturalearthdata.com/download", read=TRUE, verbose=TRUE)
what |
a character or character vector specifying which type of Natural Earth data to load, e.g., 'coastline'. To list all possible values for the specified resolution, set what='list'. If what='all', all types available for the specified resolution are loaded. |
resolution |
a character or character vector sepcifying which resolution(s) to use. Possible values are 'coarse' (1:110Mio), 'medium' (1:50Mio; default), and 'fine' (1:10Mio). |
poly.split |
a logical value indicating whether polygon objects (e.g. if |
naturalearth.dir |
a character specifying the local Natural Earth data directory. If data are downloaded from the internet, they will be save to this directory; if it does not yet exist, it will be created. Default is |
force.raw2split |
a logical value specifying whether to redo the polygon splitting even if a corresponding splitted-polygons R-object already exists. Default is |
force.shape2raw |
a logical value specifying whether to redo the conversion from the original Natural Earth shape file to an (raw, that is, not splitted) R-object if the latter already exists. Default is |
force.download |
a logical value indicating whether or not to download the data from the internet, even if it already exists locally, to replace the local file. This can be useful when updates are available. By default, force.download=FALSE . |
download.if.missing |
a logical value indicating whether or not to download the data from the internet if it is missing locally. By default, download.if.missing=TRUE . |
download.baseurl |
a character specifiying the internet base URL from which to download the data. |
read |
a logical value indicating whether or not to load (read) tha data. If FALSE, data are only downloaded (if the corresponding arguments are set accordingly). |
verbose |
a logical value indicating whether or not to print more information. |
This function, together with sl.plot.naturalearth
, enables using the openly available and free-to-use Natural Earth data (https://www.naturalearthdata.com) - including coastlines, rivers, land and ocean polygons, and much more - in spheRlab. This function is also invoked from sl.plot.naturalearth
if needed, so it does not need to be used explicitly to plot Natural Earth data.
If read=TRUE
, the package rgdal is needed to read the shape file(s).
If read=TRUE
, a named list with each element corresponding to one Natural Earth data set, with naming convention 'resolution_what'. List elements are return values of the rgdal function readOGR()
.
Helge Goessling
https://www.naturalearthdata.com
sl.plot.naturalearth
# load coastlines at coarse resolution:
load.res = sl.load.naturalearth(what="coastline",resolution="coarse")
# list all possible 'what' values for fine resolution:
sl.load.naturalearth(what="list",resolution="fine")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.