install gdal on Mac OS X


Mac OS X is built on Unix BSD and thus offers terminal and bash for good old scripting.

To add gdal and its executables (gdal_translate, gdal_merge.py etc.), go first downloading the framework prepared by KyngChaos

http://www.kyngchaos.com/software:frameworks

and download Gdal Complete.dmg.

The adaptation done for Mac OS X  is just perfect! To make it run:

mount the dmg, then double click on the installation package. Once the installation is done, you must set the PATH variable for bash.

Launch Terminal, then type

export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH

This command adds /Library/Frameworks/GDAL.framework/Programs to the search PATH.

If you want to save this setting, edit the hidden file .bash_profile in your home directory, and add the above command line; then save. For beginners: the dot ‘.’ before bash_profile corresponds to a hidden file. To immediately set the path, type

source .bash_profile

Anyway, .bash_profile will be read again next time you run a terminal.

Enjoy!

4 Responses to “install gdal on Mac OS X”


  1. 1 Gaspar Reyes Póndigo 15 March 2011 at 9:31 pm

    Thanks, I not acces to GDAL from terminal, but you tutorial “install gdal on Mac OS X” i solved the problem (export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH)

  2. 3 fer 8 March 2012 at 4:48 pm

    I cannot find .bash_profile.
    the closest I see in my home directory is .bash_history equivalent?

    • 4 bubuitalia 8 March 2012 at 9:40 pm

      No, it is not equivalent.
      The file .bash_history contains the list of command you typed. If you do
      cat .bash_history
      you’ll see on screen all those commands. The command
      history
      reads its input from this file.

      You can simply create your own .bash_profile if it does not already exist.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: