0

I'm working on a remote machine. Output from uname -a is:

Linux some-server.some-place.com 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

I'm having trouble with the R package rgeos. Here's a quick R session:

> library(rgeos)
rgeos version: 0.3-8, (SVN revision 460)
 GEOS runtime version: 3.4.2-CAPI-1.8.2 r3921 
 Polygon checking: TRUE 

> version_GEOS()
[1] "3.4.2-CAPI-1.8.2 r3921"
> example(gDistance) 

gDstnc> pt1 = readWKT("POINT(0.5 0.5)")

gDstnc> pt2 = readWKT("POINT(2 2)")

gDstnc> p1 = readWKT("POLYGON((0 0,1 0,1 1,0 1,0 0))")

gDstnc> p2 = readWKT("POLYGON((2 0,3 1,4 0,2 0))")

gDstnc> gDistance(pt1,pt2)
R: GeometryComponentFilter.cpp:34: virtual void geos::geom::GeometryComponentFilter::filter_ro(const geos::geom::Geometry*): Assertion `0' failed.

Process R exited abnormally with code 255 at Fri Feb 27 20:41:41 2015

What should I do to try and fix this?

Googling led me to http://r-sig-geo.2731867.n2.nabble.com/gDistance-problem-on-RHEL-6-64-bit-td7587736.html. I tried some of the recommendations, including running R -d gdb, but that gave essentially the same output:

> p1 = readWKT("POLYGON((0 0,1 0,1 1,0 1,0 0))")
> p2 = readWKT("POLYGON((2 0,3 1,4 0,2 0))")
> .Call("rgeos_distance", rgeos:::.RGEOS_HANDLE, p2, p1, c(FALSE, FALSE), 
+ 
   PACKAGE = "rgeos")
+ R: GeometryComponentFilter.cpp:34: virtual void geos::geom::GeometryComponentFilter::filter_ro(const geos::geom::Geometry*): Assertion `0' failed.

Program received signal SIGABRT, Aborted.
0x0000003b19c32925 in raise () from /lib64/libc.so.6
(gdb) 

Any suggestions?

Edit: More info:

output from lsb_release -a:

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.5 (Final)
Release:    6.5
Codename:   Final

output from rpm -qa | grep geos:

geos-devel-3.4.2-1.rhel6.x86_64
geos-3.4.2-1.rhel6.x86_64

output from rpm -qa | grep gdal:

gdal-java-1.9.2-4.el6.x86_64
gdal-1.9.2-4.el6.x86_64
gdal-python-1.9.2-4.el6.x86_64
gdal-libs-1.9.2-4.el6.x86_64
gdal-devel-1.9.2-4.el6.x86_64

output from echo $LD_LIBRARY_PATH:

/opt/tomlab/shared

output from which geos-config:

/usr/bin/geos-config
Adrian
  • 3,138
  • 2
  • 28
  • 39
  • Looks like a GEOS bug (http://trac.osgeo.org/geos/ticket/535) resolved in a version 3.4.3. – bergant Mar 02 '15 at 16:34
  • But it works for me with geos version 3.4.2-5. –  Mar 03 '15 at 07:03
  • @bergant and Pascal, how do I upgrade to a newer version of geos? I don't own the server, so I'd have to explain to the owner how to do it. Is there some new repo they'd have to add? – Adrian Mar 03 '15 at 08:48
  • @Pascal is that the 2013/08/25 geos-3.4.2.tar.bz2 listed at http://trac.osgeo.org/geos/ ? – Adrian Mar 03 '15 at 17:45
  • It is provided by my distribution. –  Mar 04 '15 at 10:14
  • I'm not familiar with CentOS, but have you tried installing GEOS as user, and either linking rgeos statically to it, or setting `LD_LIBRARY_PATH` to the dynamic library before running R and installing rgeos? – Edzer Pebesma Mar 06 '15 at 22:59
  • @EdzerPebesma No, I haven't, but how would I do that? Adding some edits to the main question that might be relevant – Adrian Mar 07 '15 at 12:01
  • Has anyone figured out how to statically link to it as Edzer Pebesma suggests? – gavit Dec 23 '15 at 09:58

0 Answers0