Skip to content

Commit

Permalink
Add tidyterra support (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan authored May 24, 2022
1 parent 1049e80 commit 8371f29
Show file tree
Hide file tree
Showing 29 changed files with 83 additions and 361 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/pkgdown-gh-pages-clean.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Clean pkgdown manually

jobs:
pkgdown-gh-pages-manual:
runs-on: macos-latest
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -23,11 +23,21 @@ jobs:
extra-packages:
local::.
any::pkgdown
ropenspain/rostemplate
ropenscilabs/r2readthedocs
needs: website

- name: Deploy package
- name: Update docs
run: |
r2readthedocs::rtd_build()
r2readthedocs::r2readthedocs(".")
shell: Rscript {0}

- name: Commit results
run: |
git config --local user.name "dieghernan"
git config --local user.email "dieghernan@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE, run_dont_run = TRUE)'
git add -A
git commit -m 'Update docs with pkgdev' || echo "No changes to commit"
git push origin || echo "No changes to commit"
2 changes: 1 addition & 1 deletion .github/workflows/rostemplate-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: rostemplate-gh-pages

jobs:
rostemplate-gh-pages:
runs-on: macos-latest
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: update-docs

jobs:
update-docs:
runs-on: macos-latest
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ vignettes/*.pdf
revdep
CRAN-SUBMISSION
.github/pkg.lock
docs/
inst/doc
cran-comments.md
54 changes: 15 additions & 39 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -----------------------------------------------------------
# CITATION file created with {cffr} R package, v0.2.1
# CITATION file created with {cffr} R package, v0.2.2
# See also: https://docs.ropensci.org/cffr/
# -----------------------------------------------------------

Expand All @@ -8,7 +8,7 @@ message: 'To cite package "CatastRo" in publications use:'
type: software
license: GPL-2.0-only
title: 'CatastRo: Interface to the API ''Sede Electronica Del Catastro'''
version: 0.2.1
version: 0.2.1.9000
doi: 10.5281/zenodo.6044091
abstract: Access public spatial data available under the 'INSPIRE' directive. Tools
for downloading references and addresses of properties, as well as map images.
Expand All @@ -34,7 +34,7 @@ preferred-citation:
email: diego.hernangomezherrero@gmail.com
orcid: https://orcid.org/0000-0001-8457-4658
year: '2022'
version: 0.2.1
version: 0.2.1.9000
url: https://ropenspain.github.io/CatastRo/
doi: 10.5281/zenodo.6044091
abstract: Access public spatial data available under the 'INSPIRE' directive. Tools
Expand Down Expand Up @@ -102,20 +102,6 @@ references:
email: hadley@rstudio.com
year: '2022'
url: https://CRAN.R-project.org/package=httr
- type: software
title: lifecycle
abstract: 'lifecycle: Manage the Life Cycle of your Package Functions'
notes: Imports
authors:
- family-names: Henry
given-names: Lionel
email: lionel@rstudio.com
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
orcid: https://orcid.org/0000-0003-4757-117X
year: '2022'
url: https://CRAN.R-project.org/package=lifecycle
- type: software
title: mapSpain
abstract: 'mapSpain: Administrative Boundaries of Spain'
Expand Down Expand Up @@ -243,17 +229,6 @@ references:
orcid: https://orcid.org/0000-0002-9415-4582
year: '2022'
url: https://CRAN.R-project.org/package=ggplot2
- type: software
title: ggspatial
abstract: 'ggspatial: Spatial Data Framework for ggplot2'
notes: Suggests
authors:
- family-names: Dunnington
given-names: Dewey
email: dewey@fishandwhistle.net
orcid: https://orcid.org/0000-0002-9415-4582
year: '2022'
url: https://CRAN.R-project.org/package=ggspatial
- type: software
title: knitr
abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
Expand All @@ -275,17 +250,6 @@ references:
email: Simon.Urbanek@r-project.org
year: '2022'
url: https://CRAN.R-project.org/package=png
- type: software
title: raster
abstract: 'raster: Geographic Data Analysis and Modeling'
notes: Suggests
authors:
- family-names: Hijmans
given-names: Robert J.
email: r.hijmans@gmail.com
orcid: https://orcid.org/0000-0001-5872-2872
year: '2022'
url: https://CRAN.R-project.org/package=raster
- type: software
title: rmarkdown
abstract: 'rmarkdown: Dynamic Documents for R'
Expand Down Expand Up @@ -350,3 +314,15 @@ references:
year: '2022'
url: https://CRAN.R-project.org/package=testthat
version: '>= 3.0.0'
- type: software
title: tidyterra
abstract: 'tidyterra: ''tidyverse'' Methods and ''ggplot2'' Utils for ''terra''
Objects'
notes: Suggests
authors:
- family-names: Hernangómez
given-names: Diego
email: diego.hernangomezherrero@gmail.com
orcid: https://orcid.org/0000-0001-8457-4658
year: '2022'
url: https://CRAN.R-project.org/package=tidyterra
10 changes: 4 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: CatastRo
Title: Interface to the API 'Sede Electronica Del Catastro'
Version: 0.2.1
Version: 0.2.1.9000
Authors@R: c(
person("Ángel", "Delgado Panadero", , "delgadopanadero@gmail.com", role = c("aut", "cph"),
comment = c(ORCID = "0000-0002-8189-9251")),
Expand All @@ -22,7 +22,6 @@ Depends:
Imports:
dplyr,
httr,
lifecycle,
mapSpain (>= 0.6.0),
rappdirs (>= 0.3.0),
sf (>= 1.0.0),
Expand All @@ -32,18 +31,17 @@ Imports:
xml2
Suggests:
ggplot2,
ggspatial,
knitr,
png,
raster,
rmarkdown,
slippymath,
testthat (>= 3.0.0)
testthat (>= 3.0.0),
tidyterra
VignetteBuilder:
knitr
Config/testthat/edition: 3
Copyright: © Dirección General del Catastro <https://www.catastro.meh.es/>
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.2.0
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,5 @@ export(catr_wfs_get_parcels_parcel)
export(catr_wfs_get_parcels_parcel_zoning)
export(catr_wfs_get_parcels_zoning)
export(catr_wms_get_layer)
export(get_coor)
export(get_rc)
export(near_rc)
importFrom(utils,download.file)
importFrom(utils,unzip)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# CatastRo (development version)

- Add **tidyterra** to ‘Suggests’

# CatastRo 0.2.1

- Fix CRAN tests.
Expand Down
106 changes: 0 additions & 106 deletions R/deprecated.R

This file was deleted.

9 changes: 5 additions & 4 deletions R/wms_all.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @family WMS
#' @family spatial
#'
#' @seealso [mapSpain::esp_getTiles()], [mapSpain::layer_spatraster()],
#' @seealso [mapSpain::esp_getTiles()], [tidyterra::geom_spatraster_rgb()],
#' [terra::plotRGB()].
#'
#' @export
Expand Down Expand Up @@ -80,11 +80,12 @@
#' what = "parcel"
#' )
#'
#' library(ggplot2)
#' library(mapSpain)
#' library(ggplot2)
#' library(tidyterra)
#'
#' ggplot() +
#' layer_spatraster(pict)
#' geom_spatraster_rgb(data = pict)
#'
#'
#' # With a spatial object
Expand All @@ -105,7 +106,7 @@
#'
#' ggplot() +
#' geom_sf(data = parcels, fill = "blue", alpha = 0.5) +
#' layer_spatraster(parcels_img)
#' geom_spatraster_rgb(data = parcels_img)
#' }
catr_wms_get_layer <- function(x,
srs,
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ ggplot(wfs_get_buildings) +
wms_bu <- catr_wms_get_layer(wfs_get_buildings, bbox_expand = 0.2)
# Map
# Load mapSpain for using layer_spatraster
library(mapSpain)
# Load tidyterra
library(tidyterra)
ggplot() +
layer_spatraster(wms_bu) +
geom_spatraster_rgb(data = wms_bu) +
geom_sf(data = wfs_get_buildings, fill = "red", alpha = 0.6)
```

Expand Down
Loading

0 comments on commit 8371f29

Please sign in to comment.