16

Does anybody know what's the easiest way to install GDAL 2.0 on a MacOSX?

The usual suspects kingchaos binary distribution and homebrew seem to be stuck on GDAL 1.11

I need support for TopoJSON feature properties that seem to have been included in 2.0

EDIT 2017/01/07: kingchaos binary distribution provides now the GDAL 2.1 distribution

  • The only solutions is to wait or to try to compile GDAL yourself. – gene Jul 22 '15 at 17:47
  • @gene thanks... I have no problem in building it from source... I'm wondering if there is any particular reason binaries are not available yet... Does GDAL 2.0 have any known issues? Can anybody shed some light? I'm surprised that 5 weeks have passed since 2.0 was released and there's no binary packaging yet... – tato Jul 22 '15 at 18:19
  • maybe holidays ? – gene Jul 22 '15 at 18:31
  • I've installed TopoJSON on OS X easily enough, and have converted JSON or SHP to TopoJSON. I don't see a need to have it part of GDAL. – Alex Leith Sep 14 '15 at 22:33
  • I need the reverse path: from TopoJSON to SHP, and keep the feature properties (this is what is missing in GDAL1.11) – tato Oct 4 '15 at 22:18
11

So far

brew install gdal --HEAD

resulted in

$ ogr2ogr --version
GDAL 2.1.0dev, released 2015/99/99
  • 1 error generated. error: command 'clang' failed with exit status 1 – Sant Jul 25 '16 at 11:41
  • @Sant Have more information about your error? – Jose Llausas Oct 7 '16 at 20:38
3

IMHO homebrew will be best/easiest, once their build issues are fixed. They are on the case, so if you have a GitHub account you may want to subscribe to notifications on the relevant issue - that way you'll know the moment it is available: https://github.com/Homebrew/homebrew/pull/42845

I just tried the Python easy_install route and it blew up my meagre 4GB RAM - so I'll be waiting for the brew formula..

Edit - August 2016

Homebrew now has a specific formula for GDAL 2+ gdal-20 which right now installs GDAL v2.1.0

  • The gdal-20 Formula is in an external branch. Install with brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/master/Formula/gdal-20.rb – Density 21.5 Sep 2 '16 at 13:56
  • That link is now broken. @Density21.5 – Colin Basnett Jan 10 at 23:59
3

As @Deo_Leung reported, the OSGeo Github is your friend. But it is even easier:

  brew tap osgeo/osgeo4mac
  #brew search gdal (if you want to see the various available versions)
  brew install gdal2

Start it and grab a coffee, as it is doing a real make behind the scene ;-)

Check as well the output to add the correct symlinks

  • can you add the commands to add the symlinks? – amc Dec 9 '16 at 16:40
  • This is subject to change depending on the version. Just read the output of brew install carefully, it is pretty straight forward :) – Rmatt Dec 13 '16 at 9:27
  • Except when it doesn't tell you what to run... – amc Dec 13 '16 at 13:17
  • 1
    I needed to do 'brew link --force gdal2' – amc Dec 13 '16 at 13:19
0

see OSGeo github for full detail

in short, as @Density commented(though his link has some wired characters): brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/master/Formula/gdal-20.rb

and probably you need to do the following for further usage export PATH=$PATH:/usr/local/opt/gdal-20/bin export LDFLAGS=-L/usr/local/opt/gdal-20/lib export CPPFLAGS=-I/usr/local/opt/gdal-20/include

0

Solution found here: GDAL install on Mac: pip doesn't see gdal.h

Essentially, there is an error in the gdal-py2.7.pth file in the latest version of GDAL. The best way to correct it is to compile the GDAL bindings using the special commands provided in the thread.

To compile yourself the Python bindings, download the GDAL 2.1.0 python module and

python setup.py build_ext -I/Library/Frameworks/GDAL.framework/Versions/2.1/Headers -L/Library/Frameworks/GDAL.framework/Versions/2.1/unix/lib -lgdal
python setup.py build
python setup.py install
  • 1
    Could you include the commands in your answer as links could become lost and render this answer useless – Knightshound Jan 6 '17 at 9:10
  • Sure thing, post now edited – Antonio Medrano Jan 6 '17 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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