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

Add count parameter #7

Merged
merged 10 commits into from
Nov 28, 2023
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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

3 changes: 2 additions & 1 deletion .github/workflows/pkgdown-gh-pages-clean.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ jobs:
run: |
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)'
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, run_dont_run = TRUE)'

1 change: 1 addition & 0 deletions .github/workflows/roscron-check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ jobs:
needs: check

- uses: r-lib/actions/check-r-package@v2

1 change: 1 addition & 0 deletions .github/workflows/rostemplate-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ 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)'

46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# CONTRIBUTING

## Fixing typos

Small typos or grammatical errors in documentation may be edited directly using
the GitHub web interface, so long as the changes are made in the *source* file.

- YES ✔️: you edit a roxygen comment in a `.R` file below `R/`.
- NO ❌: you edit an `.Rd` file below `man/`.

## Prerequisites

Before you make a substantial pull request, you should always file an issue and
make sure someone from the team agrees that it's a problem. If you've found a
bug, create an associated issue and illustrate the bug with a minimal
[reprex](https://www.tidyverse.org/help/#reprex).

## Pull request process

- We recommend that you create a Git branch for each pull request (PR).
- Look at the `R-CMD-check` build status before. After making changes, run
`devtools::check()` and ensure no new Notes, Warnings or Errors are
appearing.
- We recommend the tidyverse [style guide](http://style.tidyverse.org). We
also use the [styler](https://CRAN.R-project.org/package=styler) package to
apply these styles, but please **don't restyle code that has nothing to do
with your PR**.
- We use [roxygen2](https://cran.r-project.org/package=roxygen2).
- We use [testthat](https://cran.r-project.org/package=testthat).
Contributions with test cases included are easier to accept.
- For user-facing changes, add a bullet to the top of `NEWS.md` below the
current development version header describing the changes made followed by
your GitHub username, and links to relevant issue(s)/PR(s).

## Prefer to Email?

Email the person listed as maintainer in the `DESCRIPTION` file of this repo.

Though note that private discussions over email don't help others - of course
email is totally warranted if it's a sensitive problem of any kind.

## Thanks for contributing!

This contributing guide is adapted from the tidyverse contributing guide
available at
<https://raw.githubusercontent.com/r-lib/usethis/master/inst/templates/tidy-contributing.md>
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# CatastRoNav (development version)

- Improve condition handling.
- Add a `count` parameter that allows to set the maximum number of features to
be returned.

# CatastRoNav 0.0.2

- Make `sf` objects valid with `sf::st_make_valid()`.
- Make \CRANpkg{sf} objects valid with `sf::st_make_valid()`.

# CatastRoNav 0.0.1

Expand Down
8 changes: 5 additions & 3 deletions R/wfs_ad.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @seealso [sf::st_bbox()]
#'
#' @return A `sf` object.
#' @return A \CRANpkg{sf} object.
#' @source [SITNA – Catastro de Navarra](https://sitna.navarra.es/geoportal/)
#'
#' @details
Expand All @@ -18,7 +18,7 @@
#' [EPSG:25830](https://epsg.io/25830) - ETRS89 / UTM zone 30N. The result is
#' provided always in the SRS provided in `srs`.
#'
#' When `x` is a `sf` object, the value `srs` is ignored. The query is
#' When `x` is a \CRANpkg{sf} object, the value `srs` is ignored. The query is
#' performed using [EPSG:25830](https://epsg.io/25830) (ETRS89 / UTM zone 30N)
#' and the spatial object is projected back to the SRS of the initial object.
#'
Expand All @@ -37,7 +37,8 @@
#' }
#'
#' @seealso [CatastRo::catr_wfs_get_address_bbox()]
catrnav_wfs_get_address_bbox <- function(x, srs, verbose = FALSE) {
catrnav_wfs_get_address_bbox <- function(x, srs, verbose = FALSE,
count = NULL) {
# Switch to stored queries
stored_query <- "AD:Address"

Expand All @@ -51,6 +52,7 @@ catrnav_wfs_get_address_bbox <- function(x, srs, verbose = FALSE) {
service = "WFS",
request = "getfeature",
typenames = stored_query,
count = count,
# Stored query
bbox = bbox_res$bbox,
SRSNAME = bbox_res$incrs
Expand Down
13 changes: 9 additions & 4 deletions R/wfs_bu.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
#' the bounding box: `c(xmin, ymin, xmax, ymax)`
#' - A `sf/sfc` object, as provided by the **sf** package.
#' @param srs SRS/CRS to use on the query. See **Details**.
#'
#' @param verbose Logical, displays information. Useful for debugging, default
#' is `FALSE`.
#' @param count integer, indicating the maximum number of features to return.
#' The default value `NULL` does not pass this parameter to the query,
#' and the maximum number of features would be determined by the default value
#' of the API service (5,000 in this case).
#'
#' @seealso [sf::st_bbox()]
#'
#' @return A `sf` object.
#' @return A \CRANpkg{sf} object.
#' @source [SITNA – Catastro de Navarra](https://sitna.navarra.es/geoportal/)
#'
#' @details
Expand All @@ -25,7 +28,7 @@
#' [EPSG:25830](https://epsg.io/25830) - ETRS89 / UTM zone 30N. The result is
#' provided always in the SRS provided in `srs`.
#'
#' When `x` is a `sf` object, the value `srs` is ignored. The query is
#' When `x` is a \CRANpkg{sf} object, the value `srs` is ignored. The query is
#' performed using [EPSG:25830](https://epsg.io/25830) (ETRS89 / UTM zone 30N)
#' and the spatial object is projected back to the SRS of the initial object.
#'
Expand All @@ -44,7 +47,8 @@
#' }
#'
#' @seealso [CatastRo::catr_wfs_get_buildings_bbox()]
catrnav_wfs_get_buildings_bbox <- function(x, srs, verbose = FALSE) {
catrnav_wfs_get_buildings_bbox <- function(x, srs, verbose = FALSE,
count = NULL) {
# Switch to stored queries
stored_query <- "BU:Building"

Expand All @@ -58,6 +62,7 @@ catrnav_wfs_get_buildings_bbox <- function(x, srs, verbose = FALSE) {
service = "WFS",
request = "getfeature",
typenames = stored_query,
count = count,
# Stored query
bbox = bbox_res$bbox,
SRSNAME = bbox_res$incrs
Expand Down
8 changes: 5 additions & 3 deletions R/wfs_cp.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @seealso [sf::st_bbox()]
#'
#' @return A `sf` object.
#' @return A \CRANpkg{sf} object.
#' @source [SITNA – Catastro de Navarra](https://sitna.navarra.es/geoportal/)
#'
#' @details
Expand All @@ -18,7 +18,7 @@
#' [EPSG:25830](https://epsg.io/25830) - ETRS89 / UTM zone 30N. The result is
#' provided always in the SRS provided in `srs`.
#'
#' When `x` is a `sf` object, the value `srs` is ignored. The query is
#' When `x` is a \CRANpkg{sf} object, the value `srs` is ignored. The query is
#' performed using [EPSG:25830](https://epsg.io/25830) (ETRS89 / UTM zone 30N)
#' and the spatial object is projected back to the SRS of the initial object.
#'
Expand All @@ -37,7 +37,8 @@
#' }
#'
#' @seealso [CatastRo::catr_wfs_get_parcels_bbox()]
catrnav_wfs_get_parcels_bbox <- function(x, srs, verbose = FALSE) {
catrnav_wfs_get_parcels_bbox <- function(x, srs, verbose = FALSE,
count = NULL) {
# Switch to stored queries
stored_query <- "CP:CadastralParcel"

Expand All @@ -51,6 +52,7 @@ catrnav_wfs_get_parcels_bbox <- function(x, srs, verbose = FALSE) {
service = "WFS",
request = "getfeature",
typenames = stored_query,
count = count,
# Stored query
bbox = bbox_res$bbox,
SRSNAME = bbox_res$incrs
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ library(CatastRoNav)
[![rOS-badge](https://ropenspain.github.io/rostemplate/reference/figures/ropenspain-badge.svg)](https://ropenspain.es/)
[![CatastRoNav status
badge](https://ropenspain.r-universe.dev/badges/CatastRoNav)](https://ropenspain.r-universe.dev/CatastRoNav)
[![R-CMD-check](https://github.com/rOpenSpain/CatastRoNav/workflows/R-CMD-check/badge.svg)](https://github.com/rOpenSpain/CatastRoNav/actions?query=workflow%3AR-CMD-check)
[![R-CMD-check](https://github.com/rOpenSpain/CatastRoNav/actions/workflows/roscron-check-standard.yaml/badge.svg)](https://github.com/rOpenSpain/CatastRoNav/actions/workflows/roscron-check-standard.yaml)
[![codecov](https://codecov.io/gh/rOpenSpain/CatastroNav/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rOpenSpain/CatastroNav)
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.6366407-blue)](https://doi.org/10.5281/zenodo.6366407)
[![Project-Status:Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
Expand Down Expand Up @@ -62,7 +62,7 @@ install_github("rOpenSpain/CatastRoNav", dependencies = TRUE)
## Usage

The WFS service allows to download vector objects of specific cadastral
elements. The result is provided as `sf` objects (See **sf** package).
elements. The result is provided as \CRANpkg{sf} objects (See **sf** package).

```{r wfs}
library(CatastRoNav)
Expand Down Expand Up @@ -98,7 +98,7 @@ similar functionalities for Spain excluding the Basque Country and Navarre.
## Terms and conditions of use

Data provided by the Government of Navarre under [Creative Commons Attribution
(CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/deed.en_EN). The
(CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/deed.en_en). The
service is provided "as is", and without guarantee of any kind, implicit or
explicit.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![rOS-badge](https://ropenspain.github.io/rostemplate/reference/figures/ropenspain-badge.svg)](https://ropenspain.es/)
[![CatastRoNav status
badge](https://ropenspain.r-universe.dev/badges/CatastRoNav)](https://ropenspain.r-universe.dev/CatastRoNav)
[![R-CMD-check](https://github.com/rOpenSpain/CatastRoNav/workflows/R-CMD-check/badge.svg)](https://github.com/rOpenSpain/CatastRoNav/actions?query=workflow%3AR-CMD-check)
[![R-CMD-check](https://github.com/rOpenSpain/CatastRoNav/actions/workflows/roscron-check-standard.yaml/badge.svg)](https://github.com/rOpenSpain/CatastRoNav/actions/workflows/roscron-check-standard.yaml)
[![codecov](https://codecov.io/gh/rOpenSpain/CatastroNav/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rOpenSpain/CatastroNav)
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.6366407-blue)](https://doi.org/10.5281/zenodo.6366407)
[![Project-Status:Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
Expand Down Expand Up @@ -47,7 +47,7 @@ install_github("rOpenSpain/CatastRoNav", dependencies = TRUE)
## Usage

The WFS service allows to download vector objects of specific cadastral
elements. The result is provided as `sf` objects (See **sf** package).
elements. The result is provided as objects (See **sf** package).

``` r
library(CatastRoNav)
Expand Down Expand Up @@ -96,7 +96,7 @@ and Navarre.

Data provided by the Government of Navarre under [Creative Commons
Attribution (CC BY
4.0)](https://creativecommons.org/licenses/by/4.0/deed.en_EN). The
4.0)](https://creativecommons.org/licenses/by/4.0/deed.en_en). The
service is provided “as is”, and without guarantee of any kind, implicit
or explicit.

Expand Down
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.1 (2023-06-16 ucrt)",
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"author": [
{
"@type": "Person",
Expand Down Expand Up @@ -178,7 +178,7 @@
},
"SystemRequirements": null
},
"fileSize": "853.79KB",
"fileSize": "890.901KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand All @@ -199,7 +199,7 @@
],
"releaseNotes": "https://github.com/rOpenSpain/CatastRoNav/blob/master/NEWS.md",
"readme": "https://github.com/rOpenSpain/CatastRoNav/blob/main/README.md",
"contIntegration": ["https://github.com/rOpenSpain/CatastRoNav/actions?query=workflow%3AR-CMD-check", "https://app.codecov.io/gh/rOpenSpain/CatastroNav"],
"contIntegration": ["https://github.com/rOpenSpain/CatastRoNav/actions/workflows/roscron-check-standard.yaml", "https://app.codecov.io/gh/rOpenSpain/CatastroNav"],
"developmentStatus": "https://www.repostatus.org/#active",
"keywords": ["r", "maps", "spain", "navarra", "catastro", "r-package", "r-stats", "ropenspain"]
}
6 changes: 0 additions & 6 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
CMD
CRS
Cadastral
Cadastre
CatastRo
CatastRoNav’
Catastro
DOI
EPSG
ETRS
Hernangomez
Navarra
ORCID
Olite
Expand All @@ -19,9 +15,7 @@ SRS
WFS
cadastral
cadastre
codecov
de
mapSpain
organisations
pre
rOS
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.1 (2023-06-16 ucrt)",
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"version": "0.0.2.9000"
},
{
Expand Down
11 changes: 8 additions & 3 deletions man/catrnav_wfs_get_address_bbox.Rd

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

11 changes: 8 additions & 3 deletions man/catrnav_wfs_get_buildings_bbox.Rd

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

Loading
Loading