Skip to content

Commit

Permalink
Remove IGNBase.Gris from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jun 10, 2024
1 parent 2390902 commit ca72a9a
Show file tree
Hide file tree
Showing 20 changed files with 81 additions and 28 deletions.
3 changes: 3 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ references:
email: jeroen@berkeley.edu
orcid: https://orcid.org/0000-0002-4035-0289
year: '2024'
identifiers:
- type: url
value: https://curl.se/libcurl/
- type: software
title: ggplot2
abstract: 'ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics'
Expand Down
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ VignetteBuilder:
knitr
Config/Needs/check: curl
Config/Needs/coverage: covr
Config/Needs/website: ragg, reactable, rnaturalearth, tidyverse,
ropenspain/rostemplate, ropensci/rnaturalearthhires, devtools, remotes
Config/Needs/website: ragg, reactable, rnaturalearth, tidyverse, devtools,
remotes, ropenspain/rostemplate, ropensci/rnaturalearthhires,
rspatial/geodata, rgeoboundaries
Config/testthat/edition: 3
Config/testthat/parallel: true
Copyright: © EuroGeographics for the administrative boundaries. Atlas
Expand Down
22 changes: 17 additions & 5 deletions R/addProviderEspTiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,24 @@ leafletprovidersESP_v <- "v1.3.3"
#'
#' @examples
#' library(leaflet)
#' PuertadelSol <- leaflet() %>%
#' setView(lat = 40.4166, lng = -3.7038400, zoom = 18) %>%
#' addProviderEspTiles(provider = "IGNBase.Gris") %>%
#' addProviderEspTiles(provider = "RedTransporte.Carreteras")
#' leafmap <- leaflet() %>%
#' setView(lat = 40.4166, lng = -3.7038400, zoom = 6) %>%
#' addTiles(group = "Default (OSM)") %>%
#' addProviderEspTiles(
#' provider = "IDErioja.Claro",
#' group = "IDErioja Claro"
#' ) %>%
#' addProviderEspTiles(
#' provider = "RedTransporte.Carreteras",
#' group = "Carreteras"
#' ) %>%
#' addLayersControl(
#' baseGroups = c("IDErioja Claro", "Default (OSM)"),
#' overlayGroups = "Carreteras",
#' options = layersControlOptions(collapsed = FALSE)
#' )
#'
#' PuertadelSol
#' leafmap
addProviderEspTiles <- function(map, provider, layerId = NULL, group = NULL,

Check warning on line 50 in R/addProviderEspTiles.R

View workflow job for this annotation

GitHub Actions / Run lintr scanning

file=R/addProviderEspTiles.R,line=50,col=1,[object_name_linter] Variable and function name style should match snake_case or symbols.

Check warning on line 50 in R/addProviderEspTiles.R

View workflow job for this annotation

GitHub Actions / Run lintr scanning

file=R/addProviderEspTiles.R,line=50,col=48,[object_name_linter] Variable and function name style should match snake_case or symbols.
options = providerEspTileOptions()) {
# A. Check providers
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
"applicationCategory": "cartography",
"isPartOf": "https://ropenspain.es/",
"keywords": ["rOpenSpain", "tiles", "r", "maps", "spatial", "rstats", "r-package", "municipalities", "Spain", "gisco", "provinces", "ign", "administrative-boundaries", "ccaa", "static-tiles", "spain", "cran", "ropenspain", "ggplot2", "gis"],
"fileSize": "2419.184KB",
"fileSize": "2417.482KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
Binary file modified data/esp_codelist.rda
Binary file not shown.
Binary file modified data/esp_tiles_providers.rda
Binary file not shown.
Binary file modified data/leaflet.providersESP.df.rda
Binary file not shown.
Binary file modified img/README-giscoR-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/README-static-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/README-tile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 17 additions & 5 deletions man/addProviderEspTiles.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-addProviderEspTiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test_that("Testing leaflet", {
lng = -3.7038400,
zoom = 18
) %>%
addProviderEspTiles(provider = "IGNBase.Gris") %>%
addProviderEspTiles(provider = "IDErioja.Claro") %>%
addProviderEspTiles(provider = "RedTransporte.Carreteras")
)
})
7 changes: 5 additions & 2 deletions vignettes/articles/working_imagery.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ can be plotted:
```{r static3}
rioja <- esp_get_prov("La Rioja", epsg = 3857)
basemap <- esp_getTiles(rioja, "IGNBase.Gris", bbox_expand = 0.1, zoommin = 1)
basemap <- esp_getTiles(rioja, "IDErioja.Claro",
bbox_expand = 0.1,
zoommin = 1
)
masked <- esp_getTiles(rioja, "IGNBase.Todo", mask = TRUE, zoommin = 1)
Expand Down Expand Up @@ -202,7 +205,7 @@ labels <- sprintf(
leaflet(elementId = "SpainDemo", width = "100%", height = "60vh") %>%
setView(lng = -3.684444, lat = 40.308611, zoom = 5) %>%
addProviderEspTiles("IGNBase.Gris") %>%
addProviderEspTiles("IDErioja.Claro") %>%
addPolygons(
data = munic_pop,
fillColor = ~ pal(dens),
Expand Down
46 changes: 34 additions & 12 deletions vignettes/articles/x02_mapasesp.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -114,48 +114,70 @@ reactable(galicia,

### Comparando mapSpain con otras alternativas

Comparamos ahora **mapSpain** con otro paquete que proporciona objetos `sf` de
distintos paises:
Comparamos ahora **mapSpain** con otro paquete que proporciona objetos `sf` o
`SpatVector` de distintos paises:

```{r compara}
library(sf) # manipulación de datos espaciales
# rnaturalearth
library(rnaturalearth)
esp_rnat <- ne_countries("large", country = "Spain", returnclass = "sf")
esp_rnat <- ne_countries("large", country = "Spain", returnclass = "sf") %>%
st_transform(3857)
# mapSpain
esp_mapspain <- esp_get_country(epsg = 4326) %>%
st_transform(3857)
# geodata (GADM)
library(geodata)
esp_geodata <- geodata::gadm("ES", path = tempdir(), level = 0) %>%
# Convertimos de SpatVector a objecto sf
sf::st_as_sf() %>%
st_transform(3857)
esp_mapspain <- esp_get_country(epsg = 4326)
# geoboundaries
library(rgeoboundaries)
esp_rgeob <- gb_adm0("ESP") %>%
st_transform(3857)
# Imagen Ria Ferrol
tile <- esp_get_munic(munic = "Ferrol", epsg = 3857) %>%
esp_getTiles("IGNBase.Gris", bbox_expand = 0.5, zoommin = 1)
esp_getTiles("IDErioja.Claro", bbox_expand = 0.5, zoommin = 1)
# Prepara el plot
library(tidyterra)
esp_all <- bind_rows(esp_rnat, esp_mapspain)
esp_all <- bind_rows(esp_rnat, esp_mapspain, esp_geodata, esp_rgeob)
esp_all$source <- c("rnaturalearth", "mapSpain")
esp_all$source <- as_factor(c(
"rnaturalearth", "mapSpain", "geodata (GADM)",
"rgeoboundaries"
))
ggplot(esp_all) +
geom_spatraster_rgb(data = tile, maxcell = Inf) +
geom_sf(aes(color = source),
geom_sf(aes(color = source, linetype = source),
fill = NA, show.legend = "line",
linewidth = 1.2
) +
coord_sf(
crs = 4326, xlim = c(-8.384421, -8.154413), ylim = c(43.43201, 43.59545),
expand = FALSE
) +
scale_color_manual(values = c("red", "black")) +
scale_color_manual(values = c("red", "black", "green", "orange")) +
scale_linetype_manual(values = c("solid", "dotted", "dashed", "twodash")) +
theme_void() +
labs(title = "Ría de Ferrol")
```

- **rnaturalearth**: No capta bien el contorno.
- **mapSpain**: Resultados satisfactorios.
- **GADM** (libería **geodata**) y **rgeoboundaries**: Resultados muy
precisos.

### Almacenamiento

Expand Down Expand Up @@ -444,7 +466,7 @@ ggplot() +
# Usando la opción mask
madrid <- esp_get_munic_siane(munic = "^Madrid$", epsg = 3857)
madrid_mask <- esp_getTiles(madrid, "IGNBase.Gris",
madrid_mask <- esp_getTiles(madrid, "IDErioja.Claro",
mask = TRUE, crop = TRUE,
zoommin = 2
)
Expand Down Expand Up @@ -473,7 +495,7 @@ leaflet(stations,
width = "100%",
height = "60vh"
) %>%
addProviderEspTiles("IGNBase.Gris", group = "Base") %>%
addProviderEspTiles("IDErioja.Claro", group = "Base") %>%
addProviderEspTiles("MTN", group = "MTN") %>%
addProviderEspTiles("RedTransporte.Ferroviario",
group = "Lineas Ferroviarias"
Expand Down
Binary file modified vignettes/basic-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/basic2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/basic3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/choro-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/giscoR-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/thematic-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca72a9a

Please sign in to comment.