skelley
skelley

Reputation: 63

namespace load failed for ‘sf’ (R package) , unable to load shared object

I am attempting to install R 'sf' on a Centos machine. After extended problems with gdal (now fixed by building from source), I now get:

Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):

unable to load shared object '/home/my_user_name/R/x86_64-redhat-linux-gnu- library/3.4/sf/libs/sf.so': /home/my_user_name/R/x86_64-redhat-linux-gnu-library/3.4/sf/libs/sf.so: undefined symbol: ZN15OGRMultiSurface18CastToMultiPolygonEPS

How can I resolve this error?

Upvotes: 3

Views: 3397

Answers (1)

skelley
skelley

Reputation: 63

So, this problem was apparently caused by my manual install of gdal not correctly linking to geos.

So I just reinstalled gdal following these instructions (https://trac.osgeo.org/gdal/wiki/BuildingOnUnix) with --with-geos=yes as a flag to ./configure.

This solved the problem.

Upvotes: 1

Related Questions