1

I want to use the rgeos function gDelaunayTriangulation (which requires GEOS 3.4) on my Mac, but when I load rgeos it says:

> library(rgeos)
rgeos version: 0.3-2, (SVN revision 413M)
GEOS runtime version: 3.3.3-CAPI-1.7.4 

I have installed and uninstalled both rgeos and GEOS (GEOS framework v3.4.2-2 from www.kyngchaos.com) a number of times and in different orders, but no matter how I try do I get rgeos to say the runtime is anything else than 3.3.3.

What should I do to get GEOS 3.4?

1 Answer 1

1

You have an older version of GEOS installed.

Open the Terminal.app and type

geos-config --version

your result should be 3.3.3

Now, to find the file being used

which geos-config
????? 

If you install the GEOS version of Kyngchaos, the result should be:

 geos-config --version
 3.4.2
 which geos-config 
 /Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config

If not, you must adjust the path of GEOS in you bash_profile file (.bash_profile) or compile the rgeos package from source with the option

 --with-geos=/Library/Frameworks/GEOS.framework/unix.
5
  • Thanks for quick answer. When I run “geos-config --version” then I get: -bash: geos-config: command not found But after I run export PATH=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin:$PATH GEOS_LIBRARY_PATH='/Library/Frameworks/GEOS.framework/GEOS' then I get 3.4.2 I then uninstalled and reinstalled rgeos, but still get 3.3.3. Could I have another installation of GEOS I must delete?
    – Chris
    Commented Dec 6, 2013 at 22:34
  • yes, but you need to find it...
    – gene
    Commented Dec 7, 2013 at 8:36
  • 1
    or put export PATH=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin:$PATH in your .bash_profile file
    – gene
    Commented Dec 7, 2013 at 8:59
  • Ok. I added the path, but in R I still get 3.3.3. I suspect it is hardcoded in the Mac OS binary for rgeos (the package that should use GEOS).
    – Chris
    Commented Dec 7, 2013 at 20:08
  • 1
    Now got it. I needed to reinstall rgeos from source. First I downloaded the source from CRAN and then (after installing and pathing according to gene) I ran: sudo R CMD INSTALL rgeos_0.3-2.tar.gz --configure-args='--with-geos-config=/Library/Frameworks/GEOS.framework/unix/bin/geos-config'
    – Chris
    Commented Dec 7, 2013 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.