Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

vulnerability to PROJ6/GDAL3 #21

Closed
rsbivand opened this issue Jan 9, 2020 · 2 comments
Closed

vulnerability to PROJ6/GDAL3 #21

rsbivand opened this issue Jan 9, 2020 · 2 comments

Comments

@rsbivand
Copy link

rsbivand commented Jan 9, 2020

Running revdeps from sp (sp (my github fork) with development rgdal from R-Forge):

> packageVersion("sp")
[1] ‘1.3.4’
> packageVersion("rgdal")
[1] ‘1.5.3’
> rgdal::rgdal_extSoftVersion()
          GDAL GDAL_with_GEOS           PROJ             sp 
       "3.0.2"         "TRUE"        "6.2.1"        "1.3-2" 

a test fails:

> library(testthat)
> library(spdplyr)
Loading required package: dplyr

Attaching package: 'dplyr'

The following object is masked from 'package:testthat':

    matches

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Loading required package: sp
> 
> test_check("spdplyr")
── 1. Failure: group by and summarize is quiet (@test-adv-dplyr.R#14)  ─────────
`g[1:20, ] %>% summarize(alon = mean(LON), mxlat = max(LAT), mxarea = max(AREA))` produced warnings.

── 2. Failure: group by and summarize is quiet (@test-adv-dplyr.R#15)  ─────────
``%>%`(...)` produced warnings.

── 3. Failure: group by and summarize is quiet (@test-adv-dplyr.R#16)  ─────────
`g[1:10, ] %>% summarise(alon = mean(LON))` produced warnings.

══ testthat results  ═══════════════════════════════════════════════════════════
[ OK: 43 | SKIPPED: 4 | WARNINGS: 6 | FAILED: 3 ]
1. Failure: group by and summarize is quiet (@test-adv-dplyr.R#14) 
2. Failure: group by and summarize is quiet (@test-adv-dplyr.R#15) 
3. Failure: group by and summarize is quiet (@test-adv-dplyr.R#16) 

Error: testthat unit tests failed
Execution halted

See:

http://rgdal.r-forge.r-project.org/articles/PROJ6_GDAL3.html
r-spatial/sf#1231
r-spatial/sf#1187
r-spatial/sf#1146
r-spatial/discuss#28

for background. See:

r-spatial/discuss#28 (comment)

for a way of testing fixes in a docker container contributed by Jakub Nowosad.

@rsbivand
Copy link
Author

rsbivand commented Apr 1, 2020

Seeing more errors with sf 0.9-0, sp 1.4-1, rgdal 1.5-6, and dplyr, rlang and vctrs from github:

* checking examples ... ERROR
Running examples in ‘spdplyr-Ex.R’ failed
The error most likely occurred in:

> ### Name: dplyr-Spatial
> ### Title: Dplyr verbs for Spatial
> ### Aliases: dplyr-Spatial mutate.Spatial mutate_.Spatial
> ###   summarise_.Spatial summarise.Spatial group_by_.Spatial
> ###   group_by.Spatial filter_.Spatial filter.Spatial arrange_.Spatial
> ###   arrange.Spatial slice_.Spatial slice.Spatial select_.Spatial
> ###   select.Spatial rename_.Spatial rename.Spatial distinct_.Spatial
> ###   distinct.Spatial left_join.Spatial inner_join.Spatial
> 
> ### ** Examples
> 
> library(sp)
> library(maptools)
Checking rgeos availability: TRUE
> data(wrld_simpl)
> library(spdplyr) 
> library(raster)  

Attaching package: ‘raster’

The following object is masked from ‘package:dplyr’:

    select

> wrld_simpl %>% mutate(NAME = "allthesame", REGION = row_number())
class       : SpatialPolygonsDataFrame 
features    : 246 
extent      : -180, 180, -90, 83.57027  (xmin, xmax, ymin, ymax)
coord. ref. :  +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0 
variables   : 11
# A tibble: 246 x 11
   FIPS  ISO2  ISO3     UN NAME      AREA POP2005 REGION SUBREGION     LON   LAT
   <fct> <fct> <fct> <int> <chr>    <int>   <dbl>  <int>     <int>   <dbl> <dbl>
 1 AC    AG    ATG      28 allthe…     44  8.30e4      1        29  -61.8   17.1
 2 AG    DZ    DZA      12 allthe… 238174  3.29e7      2        15    2.63  28.2
 3 AJ    AZ    AZE      31 allthe…   8260  8.35e6      3       145   47.4   40.4
 4 AL    AL    ALB       8 allthe…   2740  3.15e6      4        39   20.1   41.1
 5 AM    AM    ARM      51 allthe…   2820  3.02e6      5       145   44.6   40.5
 6 AO    AO    AGO      24 allthe… 124670  1.61e7      6        17   17.5  -12.3
 7 AQ    AS    ASM      16 allthe…     20  6.41e4      7        61 -171.   -14.3
 8 AR    AR    ARG      32 allthe… 273669  3.87e7      8         5  -65.2  -35.4
 9 AS    AU    AUS      36 allthe… 768230  2.03e7      9        53  136.   -25.0
10 BA    BH    BHR      48 allthe…     71  7.25e5     10       145   50.6   26.0
# … with 236 more rows
> wrld_simpl %>% transmute(alpha = paste0(FIPS, NAME))
Error in UseMethod("transmute") : 
  no applicable method for 'transmute' applied to an object of class "c('SpatialPolygonsDataFrame', 'SpatialPolygons', 'Spatial', 'SpatialVector')"
Calls: %>% ... _fseq -> freduce -> withVisible -> <Anonymous> -> transmute
Execution halted
* checking tests ...
  Running ‘spelling.R’
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
   16. dplyr::group_vars(x)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 35 | SKIPPED: 3 | WARNINGS: 7 | FAILED: 8 ]
  1. Failure: group by and summarize is quiet (@test-adv-dplyr.R#14) 
  2. Failure: group by and summarize is quiet (@test-adv-dplyr.R#15) 
  3. Failure: group by and summarize is quiet (@test-adv-dplyr.R#16) 
  4. Error: mutate works for all geometric types (@test-basic-dplyr.R#58) 
  5. Error: mutate works (@test-basic-dplyr.R#118) 
  6. Failure: joins work (@test-basic-dplyr.R#156) 
  7. Failure: joins work (@test-basic-dplyr.R#163) 
  8. Error: tibble requirements (@test-dplyr-0.6.0.R#5) 
  
  Error: testthat unit tests failed
  Execution halted

@mdsumner
Copy link
Owner

thanks, not a vulnerability to new gdal/proj rather leftover changes required by dplyr

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

No branches or pull requests

2 participants