DEV Community

Cover image for GDAL 2 On Mac with Homebrew
Bhaskar Karambelkar
Bhaskar Karambelkar

Posted on

3

GDAL 2 On Mac with Homebrew

Originally published on my personal blog.

This is a small post about upgrading to gdal 2.x on a Mac using homebrew.

Assumptions

  • You have homebrew installed and setup.
  • You already have gdal 1.x installed via homebrew's default 'gdal' formula.

Install gdal 2.x

  • Unlink gdal 1.x using
    brew unlink gdal

  • Tap into osgeo4mac
    brew tap osgeo/osgeo4mac && brew tap --repair

  • Install gdal2.

brew install gdal2 --with-armadillo \
  --with-complete --with-libkml --with-unsupported
Enter fullscreen mode Exit fullscreen mode
  • Link gdal2
    brew link --force gdal2

  • Verify


$> gdal-config --version
2.1.1

$> gdal-config --libs
-L/usr/local/Cellar/gdal2/2.1.1/lib -lgdal

$> gdal-config --cflags
-I/usr/local/Cellar/gdal2/2.1.1/include
Enter fullscreen mode Exit fullscreen mode

Post Install

If you are using R for geo-spatial stuff, be sure to reinstall the rgdal library. Also you can now install sf in R using devtools::install_github('edzer/sfr').

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more