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

test-compat-terra.R: let CRS comparison for SpatVector depend on {terra} version #202

Merged
merged 5 commits into from
Feb 1, 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
8 changes: 4 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
SAGANGV: 0.0.7

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down Expand Up @@ -119,13 +119,13 @@ jobs:

- name: Install QGIS (Windows chocolatey)
if: matrix.config.qgis == 'chocolatey'
uses: crazy-max/ghaction-chocolatey@v2
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install qgis

- name: Install QGIS LTR (Windows chocolatey)
if: matrix.config.qgis == 'chocolatey-ltr'
uses: crazy-max/ghaction-chocolatey@v2
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install qgis-ltr

Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:

- name: Restore (or define new) R package cache
if: matrix.config.dep == ''
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ env.R_LIBS_USER }}/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SAGANGV: 0.0.7
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: qgisprocess
Title: Use 'QGIS' Processing Algorithms
Version: 0.2.0.9003
Version: 0.2.0.9004
Authors@R: c(
person("Dewey", "Dunnington", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0002-9415-4582", affiliation = "Voltron Data")),
Expand Down Expand Up @@ -65,7 +65,7 @@ Config/checklist/keywords: R; package; QGIS
Encoding: UTF-8
Language: en-GB
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
SystemRequirements: 'QGIS' latest or long-term release, currently supported
according to the 'QGIS' release schedule
(<https://www.qgis.org/en/site/getinvolved/development/roadmap.html>). Older
Expand Down
6 changes: 3 additions & 3 deletions man/st_as_sf.Rd

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

6 changes: 3 additions & 3 deletions man/st_as_stars.Rd

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

20 changes: 12 additions & 8 deletions tests/testthat/test-compat-terra.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,18 @@ test_that("terra argument coercers work for SpatVector referring to a file", {
"exactly one row and the geometry must be a point"
)

# check effect of resetting CRS
obj2 <- obj
terra::crs(obj2) <- NA
res <- expect_message(
as_qgis_argument(obj2, qgis_argument_spec(qgis_type = "vector")),
"Rewriting.*since its CRS has been set to another value"
)
expect_s3_class(res, "qgis_tempfile_arg")
if (packageVersion("terra") <= "1.7.65") {
# check effect of resetting CRS
# In terra > 1.7-65, the source is dropped from the object
# when CRS is reset, so no CRS comparison will be attempted.
obj2 <- obj
terra::crs(obj2) <- NA
res <- expect_message(
as_qgis_argument(obj2, qgis_argument_spec(qgis_type = "vector")),
"Rewriting.*since its CRS has been set to another value"
)
expect_s3_class(res, "qgis_tempfile_arg")
}

# check effect of changed attribute names
obj2 <- obj
Expand Down