Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tile API #88

Merged
merged 16 commits into from
Dec 20, 2022
Merged

Improve tile API #88

merged 16 commits into from
Dec 20, 2022

Conversation

dieghernan
Copy link
Member

@dieghernan dieghernan commented Dec 17, 2022

TODO:

  • More testing
  • Add option to download via custom url

Close #86

@codecov
Copy link

codecov bot commented Dec 17, 2022

Codecov Report

Merging #88 (5bb9ff7) into main (c40dc8d) will decrease coverage by 0.05%.
The diff coverage is 95.47%.

❗ Current head 5bb9ff7 differs from pull request most recent head 5cc3c50. Consider uploading reports for the commit 5cc3c50 to get more accurate results

@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
- Coverage   95.96%   95.90%   -0.06%     
==========================================
  Files          30       30              
  Lines        2130     2151      +21     
==========================================
+ Hits         2044     2063      +19     
- Misses         86       88       +2     
Impacted Files Coverage Δ
R/esp_cache.R 100.00% <ø> (ø)
R/esp_cache_clear.R 100.00% <ø> (ø)
R/esp_get_capimun.R 100.00% <ø> (ø)
R/esp_get_ccaa.R 100.00% <ø> (ø)
R/esp_get_comarca.R 100.00% <ø> (ø)
R/esp_get_country.R 100.00% <ø> (ø)
R/esp_get_grid_BDN.R 97.61% <ø> (ø)
R/esp_get_gridmap.R 87.50% <ø> (ø)
R/esp_get_hydrobasin.R 100.00% <ø> (ø)
R/esp_get_hypsobath.R 100.00% <ø> (ø)
... and 19 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dieghernan
Copy link
Member Author

library(mapSpain)
x <- esp_get_prov("Jaen")

my_wms <- list(
  id = "IDEAndalucia",
  q =
    paste0(
      "https://www.ideandalucia.es/wms/ortofoto2016?",
      "request=GetMap&service=WMS&version=1.1.1",
      "&format=image/png&srs=epsg:3857",
      "&layers=ortofotografia_2016_pancromatico&styles="
    )
)


gettile <- esp_getTiles(x, my_wms, verbose = TRUE)
#> Downloading from 
#> https://www.ideandalucia.es/wms/ortofoto2016?request=GetMap&service=WMS&version=1.1.1&format=image/png&srs=epsg:3857&layers=ortofotografia_2016_pancromatico&styles=&bbox=-482401.098657409,4465301.63825908,-266009.634060958,4681693.10285553&width=512&height=512
#>  to cache dir 
#> dev/IDEAndalucia


library(ggplot2)
library(tidyterra)
#> 
#> Attaching package: 'tidyterra'
#> The following object is masked from 'package:stats':
#> 
#>     filter

ggplot(x) +
  geom_spatraster_rgb(data = gettile) +
  geom_sf(fill = NA, color = "red", linewidth = 2)

image

Created on 2022-12-19 with reprex v2.0.2

@dieghernan dieghernan marked this pull request as ready for review December 20, 2022 09:06
@dieghernan dieghernan merged commit af16f5b into main Dec 20, 2022
@dieghernan dieghernan mentioned this pull request Dec 20, 2022
@dieghernan dieghernan deleted the tiles branch January 15, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More WMS?
1 participant