Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

sos4R vulnerable to forthcoming changes in sp and rgdal #155

Closed
rsbivand opened this issue Nov 16, 2019 · 4 comments
Closed

sos4R vulnerable to forthcoming changes in sp and rgdal #155

rsbivand opened this issue Nov 16, 2019 · 4 comments
Assignees

Comments

@rsbivand
Copy link

Running revdep checks for current rgdal on R-Forge - see:

https://stat.ethz.ch/pipermail/r-sig-geo/2019-November/027801.html

shows the errors in the attached test log, related to use of PROJ&/GDAL3
and required changes to sp and rgdal. If useful find a regerence to a docker
image in this thread:

r-spatial/discuss#28

Changes will occur quite fast, and packages need to be prepared.

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> ################################################################################
> # Copyright (C) 2019 by 52 North                                               #
> # Initiative for Geospatial Open Source Software GmbH                          #
> #                                                                              #
> # Contact: Andreas Wytzisk                                                     #
> # 52 North Initiative for Geospatial Open Source Software GmbH                 #
> # Martin-Luther-King-Weg 24                                                    #
> # 48155 Muenster, Germany                                                      #
> # info@52north.org                                                             #
> #                                                                              #
> # This program is free software; you can redistribute and/or modify it under   #
> # the terms of the GNU General Public License version 2 as published by the    #
> # Free Software Foundation.                                                    #
> #                                                                              #
> # This program is distributed WITHOUT ANY WARRANTY; even without the implied   #
> # WARRANTY OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
> # General Public License for more details.                                     #
> #                                                                              #
> # You should have received a copy of the GNU General Public License along with #
> # this program (see gpl-2.0.txt). If not, write to the Free Software           #
> # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA or #
> # visit the Free Software Foundation web page, http://www.fsf.org.             #
> #                                                                              #
> # Author: Daniel Nuest (daniel.nuest@uni-muenster.de)                          #
> # Created: 2010-09-24                                                          #
> # Project: sos4R - https://github.com/52North/sos4R                            #
> #                                                                              #
> ################################################################################
> 
> library("testthat")
> test_check("sos4R")
Loading required package: sos4R
── 1. Failure: CRS from boundedBy (@test_capabilities.R#81)  ───────────────────
sosGetCRS\(mapserver\)@projargs does not match "init=epsg:4326".
Actual value: "\+proj=longlat \+datum=WGS84 \+no_defs"

── 2. Failure: can get CRS from URN (@test_utils.R#53)  ────────────────────────
obj@projargs does not match "init=epsg:4326".
Actual value: "\+proj=longlat \+datum=WGS84 \+no_defs"

── 3. Failure: can get CRS from lowercase URN (@test_utils.R#59)  ──────────────
obj@projargs does not match "init=epsg:4326".
Actual value: "\+proj=longlat \+datum=WGS84 \+no_defs"

── 4. Failure: can get CRS from URN with version (@test_utils.R#65)  ───────────
obj@projargs does not match "init=epsg:4326".
Actual value: "\+proj=longlat \+datum=WGS84 \+no_defs"

── 5. Failure: can get CRS from URL (@test_utils.R#71)  ────────────────────────
obj@projargs does not match "init=epsg:4326".
Actual value: "\+proj=longlat \+datum=WGS84 \+no_defs"

══ testthat results  ═══════════════════════════════════════════════════════════
[ OK: 266 | SKIPPED: 12 | WARNINGS: 0 | FAILED: 5 ]
1. Failure: CRS from boundedBy (@test_capabilities.R#81) 
2. Failure: can get CRS from URN (@test_utils.R#53) 
3. Failure: can get CRS from lowercase URN (@test_utils.R#59) 
4. Failure: can get CRS from URN with version (@test_utils.R#65) 
5. Failure: can get CRS from URL (@test_utils.R#71) 

Error: testthat unit tests failed
Execution halted
@nuest
Copy link
Contributor

nuest commented Nov 25, 2019

Thanks for the heads up! This should be quick to fix.

Would you expect us to prepare a release for the time that new rgdal is out, or should we fix all problems now to support both "old and new" rgdal?

@rsbivand
Copy link
Author

Thanks, preferably the latter. My current feeling is that I'd like things to work approximately the same before and after, as probably Windows & OSX CRAN binaries will not be ready to go at the same time. Many Centos etc. will also stay on GDAL<3 && PROJ <6. There is an edge problem with GDAL=2 & PROJ = 6, which shouldn't really exist.

@nuest nuest self-assigned this Nov 25, 2019
@nuest
Copy link
Contributor

nuest commented Nov 25, 2019

I see. For us the problems are only in the tests, and it should be fine to relax the assertions so that both the old and new content of ..@projargs are valid. In both cases we can be certain that the parsing was successful. Alternatively, we can look into the class of the projargs field, which might be more stable for the desired check.

nuest added a commit to nuest/sos4R that referenced this issue Apr 22, 2020
@nuest nuest closed this as completed Apr 22, 2020
@rsbivand
Copy link
Author

problem still seen in sos4R 0.4.0 with sp 1.4-2, rgdal devel 1.5-8 rev 984, PROJ 7.0.1, GDAL 3.1.0:

Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
   1. sos4R:::.checkSitesDataFrameWithIdsAndCoordsAndPhenomenaInformationAndTemporalBBoxAndEmptySites(sitesDataFrame)
   2. testthat::expect_equal(...)
   4. testthat:::compare.character(act$val, exp$val, ...)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 1328 | SKIPPED: 52 | WARNINGS: 1 | FAILED: 6 ]
  1. Error: KVP::sites(sos, empty = TRUE) returns a list of stations as SpatialPointsDataFrame that contain siteIDs and coordinates (@test_sites.R#498) 
  2. Error: KVP::sites(sos, empty = FALSE) returns a list of stations as SpatialPointsDataFrame that contain siteIDs and coordinates (@test_sites.R#536) 
  3. Error: KVP: sites(sos,includePhenomena=TRUE,...) returns a list of stations as SpatialPointsDataFrame that contain siteIDs and coordinates (@test_sites.R#575) 
  4. Error: KVP: sites with metadata (@test_sites.R#614) 
  5. Error: KVP::sites(sos, empty=TRUE, includePhenomena = TRUE,...) (@test_sites.R#656) 
  6. Error: KVP::sites(sos, empty=TRUE, includePhenomena = TRUE, includeTemporalBbox = TRUE,...) (@test_sites.R#693) 
  
  Error: testthat unit tests failed
  Execution halted
> library("testthat")
> library("webmockr")
> library("sos4R")
> 
> test_check("sos4R")
── 1. Error: KVP::sites(sos, empty = TRUE) returns a list of stations as Spatial
invalid 'x' type in 'x && y'
Backtrace:
 1. sos4R:::.checkSitesDataFrameWithIdsEmptyAndCoords(sitesDataFrame)
 2. testthat::expect_equal(...)
 4. testthat:::compare.character(act$val, exp$val, ...)

── 2. Error: KVP::sites(sos, empty = FALSE) returns a list of stations as Spatia
invalid 'x' type in 'x && y'
Backtrace:
 1. sos4R:::.checkSitesDataFrameWithIdsAndCoords(sitesDataFrame)
 2. testthat::expect_equal(...)
 4. testthat:::compare.character(act$val, exp$val, ...)

── 3. Error: KVP: sites(sos,includePhenomena=TRUE,...) returns a list of station
invalid 'x' type in 'x && y'
Backtrace:
 1. sos4R:::.checkSitesDataFrameWithIdsAndCoordsAndPhenomenaInformation(sitesDataFrame)
 2. testthat::expect_equal(...)
 4. testthat:::compare.character(act$val, exp$val, ...)

── 4. Error: KVP: sites with metadata (@test_sites.R#614)  ─────────────────────
invalid 'x' type in 'x && y'
Backtrace:
 1. sos4R:::.checkSitesDataFrameWithIdsAndCoordsAndPhenomenaInformationAndTemporalBBox(sitesDataFrame)
 2. testthat::expect_equal(...)
 4. testthat:::compare.character(act$val, exp$val, ...)

── 5. Error: KVP::sites(sos, empty=TRUE, includePhenomena = TRUE,...) (@test_sit
invalid 'x' type in 'x && y'
Backtrace:
 1. sos4R:::.checkSitesDataFrameWithIdsAndCoordsAndPhenomenaInformationWithEmpty(sitesDataFrame)
 2. testthat::expect_equal(...)
 4. testthat:::compare.character(act$val, exp$val, ...)

── 6. Error: KVP::sites(sos, empty=TRUE, includePhenomena = TRUE, includeTempora
invalid 'x' type in 'x && y'
Backtrace:
 1. sos4R:::.checkSitesDataFrameWithIdsAndCoordsAndPhenomenaInformationAndTemporalBBoxAndEmptySites(sitesDataFrame)
 2. testthat::expect_equal(...)
 4. testthat:::compare.character(act$val, exp$val, ...)

══ testthat results  ═══════════════════════════════════════════════════════════
[ OK: 1328 | SKIPPED: 52 | WARNINGS: 1 | FAILED: 6 ]
1. Error: KVP::sites(sos, empty = TRUE) returns a list of stations as SpatialPointsDataFrame that contain siteIDs and coordinates (@test_sites.R#498) 
2. Error: KVP::sites(sos, empty = FALSE) returns a list of stations as SpatialPointsDataFrame that contain siteIDs and coordinates (@test_sites.R#536) 
3. Error: KVP: sites(sos,includePhenomena=TRUE,...) returns a list of stations as SpatialPointsDataFrame that contain siteIDs and coordinates (@test_sites.R#575) 
4. Error: KVP: sites with metadata (@test_sites.R#614) 
5. Error: KVP::sites(sos, empty=TRUE, includePhenomena = TRUE,...) (@test_sites.R#656) 
6. Error: KVP::sites(sos, empty=TRUE, includePhenomena = TRUE, includeTemporalBbox = TRUE,...) (@test_sites.R#693) 

Error: testthat unit tests failed
Execution halted

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants