Getting Your Mac Ready For GIS work

January 9th 2018 | Configuration, Homebrew, Mac, Open Source Software, Technology

 A terrible Mac incident required me to reformat my Mac and reinstall everything from scratch to do desktop GIS. This is also an opportunity to standardize everything on Homebrew.  The advantage to this is that all your tools are drawn from the same stack and relate to each other, in addition to being easily updatable and jointly so.    

So, how to get this otherwise wonderful machine ready to do desktop GIS work? Here we go…

Install iTerm2

This gives you a better terminal.

Install Dotfiles Repository

This gives you a big collection of configurations right out of the box, but you need to do a little work.

cd ~

git clone .dotfiles

git submodule update --init --recursive

Install Homebrew

This gives you the package management system.


You will need both Python 2 and Python 3 for certain GIS technologies, so install them both.

brew install python2 python3

Because Homebrew installs Python in a very goofy way, you will need to create a symbolic link to the Python of your choice, be it p2 or p3. I opt for P2.

sudo ln -s /usr/local/bin/python2 /usr/local/bin/python

You will also want to install virtualenvwrapper

pip2 install virtualenvwrapper

export WORKON_HOME=~/Envs mkdir -p $WORKON_HOME

source /usr/local/bin/

Edits to your ‘.zshrc’ will have to be made, please see the enclosed example for this.


brew install postgis

This will get a whole lot of dependencies for you that you will need for other GIS software, and you’re going to want to build everything with PSQL and PostGIS support, so install this first.


brew tap osgeo/osgeo4mac
brew install netcdf
brew install gdal2 --with-complete --with-unsupported --with-postgresql
export GDAL_DATA=/usr/local/opt/gdal2/share/gdal/   
# Also add the above line to ~/.bash_profile, ~/.bashrc, or some other login script
brew install grass-70 --with-netcdf --with-postgresql
brew install gdal2-grass7


GDAL 2 is the one that will give you quite a bit of headache till you realise that you can take care of it in Homebrew. Install others first though.


Install Docker the normal way and then move the storage to an external location by this method.


This one is tricky because you will need to install packages to both your p2 and p3.

pip2 install numpy scipy matplotlib processing psycopg2

pip3 install numpy scipy matplotlib psycopg2

pip3 install requests future jinja2 pygments

Then use Homebrew to install it and link to the Apps

brew install qgis2

brew linkapps qgis2


Now comes the terrible part. You will need a whole lot of fonts for GRASS and QGIS to work correctly. And this will tie up your Homebrew forever, because Homebrew can only run one process at a time. You can’t have _n_ terminals running _n_ instances of Homebrew.

First install these:

mkdir -p ~/.config/fontconfig/conf.d ; cd ~/.config/fontconfig/conf.d/

cp ~/source/fonts/fontconfig/50-enable-terminess-powerline.conf ./

sudo fc-cache -vf

Then install the Google Noto fonts:

Then use the Bazooka to get everything that’s missing:

brew tap caskroom/fonts /bin/zsh -c 'print -l "$(brew --repo caskroom/fonts)"/Casks/*(:t:r) | xargs brew cask install'


Next you will need to install R.

brew tap homebrew/science

brew install Caskroom/cask/xquartz

brew install r


# Path to your oh-my-zsh configuration.
  export ZSH=$HOME/.dotfiles/oh-my-zsh
  # if you want to use this, change your non-ascii font to Droid Sans Mono for Awesome
  # POWERLEVEL9K_MODE='awesome-patched'
  export ZSH_THEME="powerlevel9k/powerlevel9k"
  # colorcode test
  # for code ({000..255}) print -P -- "$code: %F{$code}This is how your text would look like%f"
  #export ZSH_THEME="random"
  # Set to this to use case-sensitive completion
  export CASE_SENSITIVE="true"
  # disable weekly auto-update checks
  # export DISABLE_AUTO_UPDATE="true"
  # disable colors in ls
  # export DISABLE_LS_COLORS="true"
  # disable autosetting terminal title.
  export DISABLE_AUTO_TITLE="true"
  # Which plugins would you like to load? (plugins can be found in ~/.dotfiles/oh-my-zsh/plugins/*)
  # Example format: plugins=(rails git textmate ruby lighthouse)
  plugins=(colorize compleat dirpersist autojump git gulp history cp virtualenvwrapper python)
  source $ZSH/
  test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
  source /usr/local/opt/nvm/
  autoload -U add-zsh-hook
  load-nvmrc() {
    if [[ -f .nvmrc && -r .nvmrc ]]; then
      nvm use &> /dev/null
    elif [[ $(nvm version) != $(nvm version default)  ]]; then
      nvm use default &> /dev/null
  add-zsh-hook chpwd load-nvmrc
  # Customize to your needs...
  unsetopt correct
  # run fortune on new terminal :)
  # ZSh Config things
  alias zshconfig="atom ~/.zshrc"
  ## Python things
  export PATH="/usr/local/bin:$PATH"
  export WORKON_HOME=~/Envs
  export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
  ## GDAL things
  export GDAL_DRIVER_PATH=/usr/local/lib/gdalplugins
  export GDAL_DATA=/usr/local/opt/gdal2/share/gdal/
  export PATH="/usr/local/opt/gdal2/bin:$PATH"
  # GRASS things
  export GRASS_PYTHON=/System/Library/Frameworks/Python.framework/Versions/Current/bin/pythonw