Search code examples
rtravis-cir-sfgeos

GEOS version 3.6.1 required for selecting nearest features


I'm not being able to deal with this Travis error asking for GEOS version 3.6.1 while trying to run a unit test in a package that is using sf::st_nearest_feature.

GEOS version 3.6.1 required for selecting nearest features

Everything went well with devtools::check or R CMR checks. Travis is apparently loading geos 3.5.0

The package is here.

Travis geos build fail

Travis build fail

Travis log error:

── 1. Error: (unknown) (@test-dwp.R#4)  ────────────────────────────────────────
GEOS version 3.6.1 required for selecting nearest features
Backtrace:
  1. genestdwp::dwp(vr = rings, pt = pto_carcass)
 10. sf::st_join(., filter(vr, visib != 0), join = st_nearest_feature)
 12. sf:::join(x, y, ...)
 13. sf:::CPL_geos_nearest_feature(st_geometry(x), st_geometry(y))
══ testthat results  ═══════════════════════════════════════════════════════════
[ OK: 1 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 1 ]
1. Error: (unknown) (@test-dwp.R#4) 

RCMD check

-- R CMD check results ------------------------------------ genestdwp 0.1.0 ----
Duration: 1m 18.4s

0 errors v | 0 warnings v | 0 notes v

R CMD check succeeded

This is all new for me. Any help will be very appreciated.


Solution

  • It looks like the issue is with the dist in your .travis.yml file. Try changing to xenial for example which is a version of ubuntu which seems to support libgeos-3.7.1.

    language: r
    cache: packages
    latex: false
    sudo: true
    dist: xenial