OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
363 stars 111 forks source link

gdal-filegdb.rb tested on mavericks? #8

Closed smnorris closed 7 years ago

smnorris commented 10 years ago

I don't see any reference to gcc version in gdal-filegdb.rb, but have no experience with Ruby or setup scripts - is this tested on Mavericks?

I've tried a few things to get filegdb api to work with homebrew gdal on Mavericks but haven't had any luck:

esri forum stack exchage

dakcarto commented 10 years ago

Hi,

I have not tested that formula since moving over to Mavericks recently. I will do so this weekend. Should be able to include @jctull's workaround as well.

Thanks for reporting on this.

smnorris commented 10 years ago

Thanks for this and all the formulas. The workaround is well documented but I seem to be missing something.

dakcarto commented 10 years ago

Ok, I have FileGDB driver working on Mavericks, without recompiling gdal or any of its dependencies, or installing a different compiler than the clang default. The key appears to be that it is loaded as a shared GDAL plugin. Tested via GDAL and in QGIS, with Topo sample included in FileGDB_API_1_3-64 archive.

Before testing this formula, you need to do the following (basically, undo everything you have done to get it to work, first):

  1. Make sure any filegdb libs are removed from HOMEBREW_PREFIX/lib
  2. Recompile everything done with gcc-4.9 with the default clang (no special options). Specifically, make sure to recompile gdal. This means everything should back to normal 10.9 libc++ builds.

Install gdal-filegdb shared plugin by doing the following:

  1. Update environment with: export GDAL_THIRD_PARTY=/path/to/gdal/third-party/directory
  2. Place FileGDB_API_1_3-64.zip archive in GDAL_THIRD_PARTY directory (no need to expand archive, it will be staged by Homebrew).
  3. Run brew update to ensure latest changes from this tap are pulled. You may need to do brew tap --repair if you have been locally messing around in the osgeo4mac tap.
  4. brew install gdal-filegdb

Must say, I don't know why the shared plugin works since it is still mixing libc++ and libstdc++ library builds, but... it does.

dakcarto commented 10 years ago

Rats! It only half-works in QGIS. Any access to the attribute table causes a std::basic_string conflict between the libraries and crashes QGIS. However, you can convert the layers (via gdal or QGIS) to other formats, like Spatialite, with the attributes intact.

smnorris commented 10 years ago

No luck.

I removed the fgdb api files, uninstalled all gdal dependencies (other than postgres), then

$ export GDAL_THIRD_PARTY=/path/to/api/archive
$ brew update        
$ brew install gdal
$ brew tap dakcarto/osgeo4mac
$ brew install gdal-filegdb
$ which ogrinfo
/usr/local/bin/ogrinfo
$ ogrinfo --formats
Supported Formats:
  -> "ESRI Shapefile" (read/write)
  -> "MapInfo File" (read/write)
  -> "UK .NTF" (readonly)
  -> "SDTS" (readonly)
  -> "TIGER" (read/write)
  -> "S57" (read/write)
  -> "DGN" (read/write)
  -> "VRT" (readonly)
  -> "REC" (readonly)
  -> "Memory" (read/write)
  -> "BNA" (read/write)
  -> "CSV" (read/write)
  -> "GML" (read/write)
  -> "GPX" (read/write)
  -> "KML" (read/write)
  -> "GeoJSON" (read/write)
  -> "GMT" (read/write)
  -> "SQLite" (read/write)
  -> "ODBC" (read/write)
  -> "PGeo" (readonly)
  -> "MSSQLSpatial" (read/write)
  -> "PostgreSQL" (read/write)
...etc

no sign of -> "FileGDB" (read/write) but the files are there:

$ cd /usr/local/opt/gdal-filegdb
$ ls
INSTALL_RECEIPT.json  LICENSE.TXT  NEWS  filegdb  lib

Oh well, I can just keep using the kyngchaos binaries for now.

dakcarto commented 10 years ago

If gdal-filegdbsuccessfully installed, it sounds like you may have missed the last step, as outlined in the formula's caveats:

This formula provides a plugin that allows GDAL or OGR to access geospatial
data stored in its format. In order to use the shared plugin, you will need
to set the following environment variable:

  export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins

Without GDAL_DRIVER_PATH, GDAL won't know where to find the plugin(s). This is the same as for gdal-grass.

smnorris commented 10 years ago

Ah, of course - that does the trick. Thanks!

dakcarto commented 10 years ago

Leaving open, as the C++ std lib issue remains unresolved upstream for Mavericks, in ESRI's download package for FileGDB_API_1_3-64.zip.

smnorris commented 8 years ago

I've happily been using the OpenFileGDB for the past couple of years but now have the requirement to write to .gdb files. Rather than open up arcgis it would be nice to use ogr2ogr and the FileGDB driver. ESRI has updated the api (1.4) and there are now two files for Mac (clang and gcc) http://www.esri.com/apps/products/download/.

Has anyone tried using these latest with homebrew on El Captain 10.11?

smnorris commented 8 years ago

I've just tried the 1.4 clang version and it seems to be fine so far.

Rather than update this formula, I just went back to the copy api files into /usr/local/include /usr/local/lib method noted here

I'd update the formula but learning ruby is out of scope for the moment :)

dakcarto commented 7 years ago

Closing as related to deprecated formulae. Reopen if necessary.

Try gdal1-filegdb or gdal2-filegdb.