Skip to content

Instantly share code, notes, and snippets.

@openfirmware
Created March 28, 2019 19:29
Show Gist options
  • Save openfirmware/26fa9ae413af626ed16d1dd09b614b42 to your computer and use it in GitHub Desktop.
Save openfirmware/26fa9ae413af626ed16d1dd09b614b42 to your computer and use it in GitHub Desktop.
ST_MakeValid and other functions on libspatialite/GDAL on MacOS with Homebrew
$ brew install liblwgeom
$ export LDFLAGS="-L/usr/local/opt/liblwgeom/lib"
$ export CPPFLAGS="-I/usr/local/opt/liblwgeom/include"
$ brew edit libspatialite
(add --enable-lwgeom to configure)
$ brew reinstall -s libspatialite
$ brew install -s gdal
@openfirmware
Copy link
Author

Hmm, I am having issues with PostGIS now. Maybe the FLAGS need to refer to postgis instead of liblwgeom.

@ryanmark
Copy link

ryanmark commented Aug 23, 2019

The export variables didn't work for me. Had to add the following to the libspatialite brew recipe:

    lwgeom = Formula["liblwgeom"]
    ENV.append "LDFLAGS", "-L#{lwgeom.opt_lib}"
    ENV.append "CFLAGS", "-I#{lwgeom.opt_include}"

@robsalasco
Copy link

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment