21

I am looking for the equivalent of FWTools for Mac OS X, Lion. Is there anything I can easily install and get that command?

CLJ
  • 823
  • 1
  • 6
  • 17

4 Answers4

40

ogr2ogr is part of the Geospatial Data Abstraction Library (GDAL).

  1. Get homebrew from http://brew.sh
  2. brew install gdal
Meekohi
  • 501
  • 1
  • 4
  • 4
18

You can find Mac GDAL downloads here: http://www.kyngchaos.com/software/archive#gdal OGR and the associated utilities (i.e ogr2ogr and ogrinfo) are included with GDAL.

user2856
  • 65,736
  • 6
  • 115
  • 196
8

Taking the information from the above, here's how you would actually get the ogr2ogr command working like it should

  • add this to your ~/.bash_profile script:

    export PATH=/Library/Frameworks/GDAL.framework/Versions/1.[YOURVERSIONHERE]/Programs/:$PATH
    

the above code also adds a bunch of other gdal libraries to your path as well

boulder_ruby
  • 1,824
  • 4
  • 27
  • 43
  • Well put @boulder_ruby - exactly what I needed! – Joey Schluchter Jan 21 '14 at 15:34
  • 1
    You can also use "Current" as the [YOURVERSIONHERE] – Tom Lee Oct 22 '18 at 14:07
  • Try restarting your computer after you add this to your path. And if that doesn't work, try adding a manual PATH variable to the QGIS settings page: https://gis.stackexchange.com/questions/285832/gdalbuildvrt-command-not-found-in-build-virtual-raster-tool – oatmilkyway Nov 07 '18 at 04:57
  • @plnnr not necessary. To reload ~/.bash_profile just reload a new terminal or run source ~/.bash_profile – boulder_ruby Dec 19 '18 at 15:03
0

brew install gdal

You will either have to symlink the ogr2ogr binary to your PATH our just use it directly. in my case. I found it under /opt/homebrew/opt/gdal/bin/ogr2ogr using:

brew --prefix gdal
tdeegan
  • 101