ne_load: load a Natural Earth vector that has already been downloaded...

Description Usage Arguments Value See Also Examples

Description

returns loaded data as a spatial object.

Usage

1
2
3
ne_load(scale = 110, type = "countries", category = c("cultural",
  "physical", "raster"), destdir = tempdir(), file_name = NULL,
  returnclass = c("sp", "sf"))

Arguments

scale

scale of map to return, one of 110, 50, 10 or 'small', 'medium', 'large'

type

type of natural earth file one of 'countries', 'map_units', 'map_subunits', 'sovereignty', 'states' OR the portion of any natural earth vector url after the scale and before the . e.g. for 'ne_50m_urban_areas.zip' this would be 'urban_areas' OR the raster filename e.g. for 'MSR_50M.zip' this would be 'MSR_50M'

category

one of natural earth categories : 'cultural', 'physical', 'raster'

destdir

folder to load files from, default=tempdir()

file_name

OPTIONAL name of file (excluding path) instead of natural earth attributes

returnclass

'sp' default or 'sf' for Simple Features

Value

A Spatial object depending on the data (points, lines, polygons or raster).

See Also

ne_download

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
# download followed by load from tempdir() works in same R session
spdf_world <- ne_download( scale = 110, type = 'countries' )
spdf_world2 <-    ne_load( scale = 110, type = 'countries' )

# download followed by load from specified directory works between R sessions
spdf_world <- ne_download( scale = 110, type = 'countries', destdir = getwd() )
spdf_world2 <-    ne_load( scale = 110, type = 'countries', destdir = getwd() )

# for raster
# download & load
rst <- ne_download(scale = 50, type = 'OB_50M', category = 'raster', destdir = getwd())

# load after having downloaded
rst <- ne_load(scale = 50, type = 'OB_50M', category = 'raster', destdir = getwd())

# plot
library(raster)
plot(rst)

## End(Not run) # end dontrun

rnaturalearth documentation built on May 1, 2019, 10:26 p.m.