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 documentation #47

Merged
merged 5 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/pkgdown-gh-pages-clean.yaml

This file was deleted.

15 changes: 9 additions & 6 deletions .github/workflows/rostemplate-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- main
- master
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: rostemplate-gh-pages

Expand All @@ -11,6 +14,7 @@ jobs:
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CURL_SSL_BACKEND: "openssl"
steps:
- uses: actions/checkout@v4

Expand All @@ -19,11 +23,11 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
install-r: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages:
extra-packages: |
local::.
any::pkgdown
ropenspain/rostemplate
Expand All @@ -34,4 +38,3 @@ jobs:
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, run_dont_run = TRUE)'

3 changes: 2 additions & 1 deletion .github/workflows/update-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CURL_SSL_BACKEND: "openssl"

steps:
- uses: actions/checkout@v4

Expand All @@ -20,7 +22,6 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: |
local::.
any::cli
Expand Down
12 changes: 8 additions & 4 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.5.0
# CITATION file created with {cffr} R package, v1.0.0
# See also: https://docs.ropensci.org/cffr/
# -----------------------------------------------------------

Expand Down Expand Up @@ -67,11 +67,10 @@ references:
url: https://www.R-project.org/
authors:
- name: R Core Team
location:
name: Vienna, Austria
year: '2024'
institution:
name: R Foundation for Statistical Computing
address: Vienna, Austria
year: '2024'
version: '>= 3.6'
- type: software
title: dplyr
Expand Down Expand Up @@ -161,6 +160,7 @@ references:
authors:
- family-names: Gagolewski
given-names: Marek
orcid: https://orcid.org/0000-0003-0637-6028
- family-names: Tartanus
given-names: Bartek
- family-names: Unicode
Expand Down Expand Up @@ -244,6 +244,10 @@ references:
- family-names: Dunnington
given-names: Dewey
orcid: https://orcid.org/0000-0002-9415-4582
- family-names: Brand
given-names: Teun
name-particle: van den
orcid: https://orcid.org/0000-0002-9335-7468
year: '2024'
- type: software
title: knitr
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ Suggests:
tidyterra
VignetteBuilder:
knitr
Config/Needs/website: ropenspain/rostemplate, devtools, sessioninfo
Config/Needs/website: ropenspain/rostemplate, devtools, sessioninfo,
remotes, sfheaders, rapidjsonr, jsonify, geometries
Config/testthat/edition: 3
Config/testthat/parallel: true
Copyright: © Dirección General del Catastro <https://www.catastro.meh.es/>
Expand Down
14 changes: 5 additions & 9 deletions R/atom_ad.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#' ATOM INSPIRE: Download all the Addresses of a Municipality
#'
#'
#' Get the spatial data of all the addresses belonging to a single
#' municipality using the INSPIRE ATOM service. Additionally, the function also
#' returns the corresponding street information on the fields with the
#' prefix `tfname_*`.
#' Get the spatial data of all the addresses belonging to a single municipality
#' using the INSPIRE ATOM service. Additionally, the function also returns the
#' corresponding street information on the fields with the prefix `tfname_*`.
#'
#' @references
#' [API
#' Documentation](https://www.catastro.minhap.es/webinspire/documentos/inspire-ATOM.pdf)
#'
#' [INSPIRE Services for Cadastral
#' Cartography](https://www.catastro.minhap.es/webinspire/index.html)
#'
#' ```{r child = "man/chunks/atompdf.Rmd"}
#' ```
#'
#' @family INSPIRE
#' @family ATOM
Expand Down
6 changes: 3 additions & 3 deletions R/atom_ad_db.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
#' **About caching** section on [catr_set_cache_dir()].
#'
#' @param update_cache A logical whether to update cache. Default is `FALSE`.
#' When set to `TRUE` it would force a fresh download of the source file.
#' When set to `TRUE` it would force a fresh download of the source file.
#'
#' @rdname catr_atom_get_address_db
#' @export
#'
#' @return
#' A \CRANpkg{tibble} with the information requested.
#' A [`tibble`][tibble::tibble] with the information requested.
#' - `catr_atom_get_address_db_all()` includes the following fields:
#' - `territorial_office`: Territorial office, corresponding to each province
#' of Spain expect Basque Country and Navarre.
Expand Down Expand Up @@ -80,7 +80,7 @@ catr_atom_get_address_db_all <- function(cache = TRUE,
#' @name catr_atom_get_address_to
#' @export
#' @param to Territorial office. It can be any type of string, the function
#' would perform a search using [base::grep()].
#' would perform a search using [base::grep()].
catr_atom_get_address_db_to <- function(to,
cache = TRUE,
update_cache = FALSE,
Expand Down
35 changes: 17 additions & 18 deletions R/atom_bu.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
#' using the INSPIRE ATOM service.
#'
#' @references
#' [API
#' Documentation](https://www.catastro.minhap.es/webinspire/documentos/inspire-ATOM.pdf)
#'
#' [INSPIRE Services for Cadastral
#' Cartography](https://www.catastro.minhap.es/webinspire/index.html)
#'
#' ```{r child = "man/chunks/atompdf.Rmd"}
#' ```

#' @family INSPIRE
#' @family ATOM
#' @family buildings
Expand All @@ -20,9 +18,10 @@
#' @return A \CRANpkg{sf} object.
#'
#' @inheritParams catr_atom_get_parcels
#' @param what Information to load. It could be `"building"` for buildings,
#' `"buildingpart"` for parts of a building or `"other"` for others (
#' swimming pools, etc.).
#' @param what Information to load. It could be:
#' - `"building"` for buildings.
#' - `"buildingpart"` for parts of a building.
#' - `"other"` for others elements, as swimming pools, etc.
#' @examples
#' \donttest{
#' s <- catr_atom_get_buildings("Nava de la Asuncion",
Expand All @@ -43,17 +42,17 @@
#' )
#' }
#'
catr_atom_get_buildings <- function(munic,
to = NULL,
what = "building",
cache = TRUE,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE) {
catr_atom_get_buildings <- function(munic, to = NULL,
what = c(
"building", "buildingpart",
"other"
),
cache = TRUE, update_cache = FALSE,
cache_dir = NULL, verbose = FALSE) {
# Sanity checks
if (!(what %in% c("building", "buildingpart", "other"))) {
stop("'what' should be 'building', 'buildingpart', 'other'")
}

what <- match.arg(what)


# Transform
what <- switch(what,
Expand Down
11 changes: 2 additions & 9 deletions R/atom_bu_db.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#'
#' @description
#'
#'
#' Create a database containing the urls provided in the INSPIRE ATOM service
#' of the Spanish Cadastre for extracting buildings.
#'
Expand All @@ -22,19 +21,15 @@
#' @family buildings
#' @family databases
#'
#' @inheritParams catr_atom_get_address_db_all
#' @inheritParams catr_set_cache_dir
#'
#' @param cache A logical whether to do caching. Default is `TRUE`. See
#' **About caching** section on [catr_set_cache_dir()].
#'
#' @param update_cache A logical whether to update cache. Default is `FALSE`.
#' When set to `TRUE` it would force a fresh download of the source file.
#'
#' @rdname catr_atom_get_buildings_db
#' @export
#'
#' @return
#' A \CRANpkg{tibble} with the information requested.
#' A [`tibble`][tibble::tibble] with the information requested.
#' - `catr_atom_get_buildings_db_all()` includes the following fields:
#' - `territorial_office`: Territorial office, corresponding to each province
#' of Spain expect Basque Country and Navarre.
Expand Down Expand Up @@ -78,8 +73,6 @@ catr_atom_get_buildings_db_all <- function(cache = TRUE,
#' @rdname catr_atom_get_buildings_db
#' @name catr_atom_get_buildings_to
#' @export
#' @param to Territorial office. It can be any type of string, the function
#' would perform a search using [base::grep()].
catr_atom_get_buildings_db_to <- function(to,
cache = TRUE,
update_cache = FALSE,
Expand Down
6 changes: 2 additions & 4 deletions R/atom_cp.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
#' municipality using the INSPIRE ATOM service.
#'
#' @references
#' [API
#' Documentation](https://www.catastro.minhap.es/webinspire/documentos/inspire-ATOM.pdf)
#'
#' [INSPIRE Services for Cadastral
#' Cartography](https://www.catastro.minhap.es/webinspire/index.html)
#' ```{r child = "man/chunks/atompdf.Rmd"}
#' ```
#'
#' @family INSPIRE
#' @family ATOM
Expand Down
11 changes: 2 additions & 9 deletions R/atom_cp_db.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,14 @@
#' @family parcels
#' @family databases
#'
#' @inheritParams catr_atom_get_address_db_all
#' @inheritParams catr_set_cache_dir
#'
#' @param cache A logical whether to do caching. Default is `TRUE`. See
#' **About caching** section on [catr_set_cache_dir()].
#'
#' @param update_cache A logical whether to update cache. Default is `FALSE`.
#' When set to `TRUE` it would force a fresh download of the source file.
#'
#' @rdname catr_atom_get_parcels_db
#' @export
#'
#' @return
#' A \CRANpkg{tibble} with the information requested.
#' A [`tibble`][tibble::tibble] with the information requested.
#' - `catr_atom_get_parcels_db_all()` includes the following fields:
#' - `territorial_office`: Territorial office, corresponding to each province
#' of Spain expect Basque Country and Navarre.
Expand Down Expand Up @@ -78,8 +73,6 @@ catr_atom_get_parcels_db_all <- function(cache = TRUE,
#' @rdname catr_atom_get_parcels_db
#' @name catr_atom_get_parcels_to
#' @export
#' @param to Territorial office. It can be any type of string, the function
#' would perform a search using [base::grep()].
catr_atom_get_parcels_db_to <- function(to,
cache = TRUE,
update_cache = FALSE,
Expand Down
2 changes: 1 addition & 1 deletion R/atom_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @param munic Municipality to extract, It can be a part of a string or the
#' cadastral code.
#'
#' @return A \CRANpkg{tibble}.
#' @return A [`tibble`][tibble::tibble].
#'
#' @export
#'
Expand Down
Loading