Install Spatialite on OS X Yosemite

I am having problems installing Spatialite tools on OS X Yosemite, first of all I read Install Spatialite for python (GeoDjango) on OS X , but this did not help me solve the problem.

Here I will provide the steps that I have taken to set the spatial path using Homebrew.

1) Install the latest version of sqlite3

brew install sqlite ==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.8.8.3.yosemite.bottle.tar.gz Already downloaded: /Library/Caches/Homebrew/sqlite-3.8.8.3.yosemite.bottle.tar.gz ==> Pouring sqlite-3.8.8.3.yosemite.bottle.tar.gz ==> Caveats This formula is keg-only, which means it was not symlinked into /usr/local. Mac OS X already provides this software and installing another version in parallel can cause all kinds of trouble. OS X provides an older sqlite3. Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables: LDFLAGS: -L/usr/local/opt/sqlite/lib CPPFLAGS: -I/usr/local/opt/sqlite/include ==> Summary 🍺 /usr/local/Cellar/sqlite/3.8.8.3: 9 files, 2.1M 

2) Install libspatialite

 brew install libspatialite ==> Downloading https://homebrew.bintray.com/bottles/libspatialite-4.2.0_1.yosemite.bottle.tar.gz Already downloaded: /Library/Caches/Homebrew/libspatialite-4.2.0_1.yosemite.bottle.tar.gz ==> Pouring libspatialite-4.2.0_1.yosemite.bottle.tar.gz 🍺 /usr/local/Cellar/libspatialite/4.2.0_1: 26 files, 17M 

3) Installation of spatial tools

 brew install spatialite-tools ==> Downloading https://homebrew.bintray.com/bottles/spatialite-tools-4.2.0.yosemite.bottle.3.tar.gz Already downloaded: /Library/Caches/Homebrew/spatialite-tools-4.2.0.yosemite.bottle.3.tar.gz ==> Pouring spatialite-tools-4.2.0.yosemite.bottle.3.tar.gz 🍺 /usr/local/Cellar/spatialite-tools/4.2.0: 21 files, 804K 

4) Looks good so far, let's try using spaceite

 spatialite -version SQLite header and source version mismatch 2015-02-25 13:29:11 9d6c1880fb75660bbabd693175579529785f8a6b 2014-12-09 01:34:36 f66f7a17b78ba617acde90fc810107f34f1a1f2e 

So it looks like the feature is built on top of sqlite3 (F66f7a17b78ba617acde90fc810107f34f1a1f2e) but not (9d6c1880fb75660bbabd693175579529785f8a6b)

Current Version 3.8.8.3 9d6c1880fb75660bbabd693175579529785f8a6b

Required Version 3.8.7.4 f66f7a17b78ba617acde90fc810107f34f1a1f2e

To fix this, I need to manually install sqlite 3.8.7.4 instead of 3.8.8.3, which is the latest version in homebrew

6) Uninstall currently installed sqlite

 brew remove sqlite brew unlink sqlite 

7) Install sqlite 3.8.7.4

Download tarbal here https://www.sqlite.org/src/info/f66f7a17b78ba617acde90fc810107f34f1a1f2e and unzip the contents

Install with

 ./configure sudo make clean sudo make sudo make install 

8) Try creating a spatial database

 spatialite geo.db "SELECT InitSpatialMetaData();" dyld: lazy symbol binding failed: Symbol not found: _sqlite3_rtree_geometry_callback Referenced from: /usr/local/lib/libspatialite.7.dylib Expected in: /usr/local/lib/libsqlite3.0.dylib dyld: Symbol not found: _sqlite3_rtree_geometry_callback Referenced from: /usr/local/lib/libspatialite.7.dylib Expected in: /usr/local/lib/libsqlite3.0.dylib Trace/BPT trap: 5 

So the problem is that it cannot find _sqlite3_rtree_geometry_callback in the library ...

Please tell me what I did wrong, or if there is a better way to install it on OS X

thank you for your time

+6
source share

Source: https://habr.com/ru/post/983934/


All Articles