This function is defunct. Use 'maptiles::get_tiles()' instead.

getTiles(
  x,
  type = "OpenStreetMap",
  zoom = NULL,
  crop = FALSE,
  verbose = FALSE,
  apikey = NA,
  cachedir = FALSE,
  forceDownload = FALSE
)

Arguments

x

an sf object, a simple feature collection or a Spatial*DataFrame.

type

the tile server from which to get the map. See Details for providers. For other sources use a list: type = list(src = "name of the source" , q = "tiles address", sub = "subdomains", cit = "how to cite the tiles"). See Examples.

zoom

the zoom level. If null, it is determined automatically (see Details).

crop

TRUE if results should be cropped to the specified x extent, FALSE otherwise. If x is an sf object with one POINT, crop is set to FALSE.

verbose

if TRUE, tiles filepaths, zoom level and citation are displayed.

apikey

Needed for Thunderforest maps.

cachedir

name of a directory used to cache tiles. If TRUE, places a 'tile.cache' folder in the working directory. If FALSE, tiles are not cached.

forceDownload

if TRUE, cached tiles are downloaded again.

Value

A RasterBrick is returned.

Details

Zoom levels are described on the OpenStreetMap wiki: https://wiki.openstreetmap.org/wiki/Zoom_levels.

Full list of providers:

'OpenStreetMap' (or 'osm')'Stamen' (or 'stamenbw')'Esri'
'OpenStreetMap.DE''Stamen.Toner''Esri.WorldStreetMap'
'OpenStreetMap.France''Stamen.TonerBackground''Esri.DeLorme'
'OpenStreetMap.HOT' (or 'hotstyle')'Stamen.TonerHybrid''Esri.WorldTopoMap'
'Stamen.TonerLines''Esri.WorldImagery'
'OpenMapSurfer''Stamen.TonerLabels''Esri.WorldTerrain'
'OpenMapSurfer.Roads''Stamen.TonerLite''Esri.WorldShadedRelief'
'OpenMapSurfer.Hybrid''Stamen.Watercolor' (or 'stamenwatercolor')'Esri.OceanBasemap'
'OpenMapSurfer.AdminBounds''Stamen.Terrain''Esri.NatGeoWorldMap'
'OpenMapSurfer.ElementsAtRisk''Stamen.TerrainBackground''Esri.WorldGrayCanvas'
'Stamen.TerrainLabels'
'CartoDB''Hydda'
'CartoDB.Positron' (or 'cartolight')'Thunderforest''Hydda.Full'
'CartoDB.PositronNoLabels''Thunderforest.OpenCycleMap''Hydda.Base'
'CartoDB.PositronOnlyLabels''Thunderforest.Transport''Hydda.RoadsAndLabels'
'CartoDB.DarkMatter' (or 'cartodark')'Thunderforest.TransportDark'
'CartoDB.DarkMatterNoLabels''Thunderforest.SpinalMap''HikeBike' (or 'hikebike')
'CartoDB.DarkMatterOnlyLabels''Thunderforest.Landscape''HikeBike.HikeBike'
'CartoDB.Voyager''Thunderforest.Outdoors'
'CartoDB.VoyagerNoLabels''Thunderforest.Pioneer''OpenTopoMap' (or 'opentopomap')
'CartoDB.VoyagerOnlyLabels''Thunderforest.MobileAtlas''Wikimedia'
'CartoDB.VoyagerLabelsUnder''Thunderforest.Neighbourhood''OpenStreetMap.MapnikBW' (or 'osmgrayscale')

See also

Examples

# install.packages('maptiles')