24

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

Aaron
  • 51,658
  • 28
  • 154
  • 317
tato
  • 823
  • 2
  • 7
  • 11
  • 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 04 '15 at 22:18

5 Answers5

22

So far

brew install gdal --HEAD

resulted in

$ ogr2ogr --version
GDAL 2.1.0dev, released 2015/99/99
tato
  • 823
  • 2
  • 7
  • 11
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

MatzFan
  • 470
  • 3
  • 10
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

Rmatt
  • 141
  • 3
1

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

Deo Leung
  • 201
  • 1
  • 4
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