Last active
December 12, 2023 09:42
-
-
Save rCarto/c4bcbed525b5428bf01563548ba2d20f to your computer and use it in GitHub Desktop.
Revisions
-
rCarto revised this gist
Dec 12, 2023 . 1 changed file with 17 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,25 @@ ``` r # Your Stadia API key: apikey = "xxxxxxxxxxxxxxxxxxxxxxx" # Define a bounding box library(sf) bb <- st_bbox(obj = c(xmin = 24.73592, xmax = 24.75185, ymin = 59.4340, ymax = 59.4393), crs = "EPSG:4326") # Download and compose Stadia/stamen tiles library(maptiles) stam <- get_tiles(x = bb, provider = "Stadia.Stamen.TonerLite", apikey = apikey, project = FALSE) # Display the basemap library(mapsf) mf_raster(stam) mf_credits(get_credit('Stadia.Stamen.TonerLite'), bg = "white") mf_title("Stamen Toner Lite Basemap", tab = FALSE) ``` <!-- --> <sup>Created on 2023-12-12 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup> -
rCarto created this gist
Dec 11, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ ``` r # Your Stadia API key: apikey = "xxxxxxxxxxxxxxxxxxxxxxx" library(sf) #> Linking to GEOS 3.11.1, GDAL 3.6.2, PROJ 9.1.1; sf_use_s2() is TRUE library(maptiles) nc <- st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) nc_osm <- get_tiles(nc, provider = "Stadia.Stamen.TonerLite", project = FALSE, apikey = apikey) plot_tiles(nc_osm) ``` <!-- --> <sup>Created on 2023-12-11 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup>