Spatial Database

I’m looking at adding routing functions into an app and therefore need to use a properly constructed database. Since SQLite has always played nice for me, I’ve decided to use Spatialite, which is a spatial extenion for SQLite, together with data from OpenStreetMap.

The precompiled binaries include a spatialite lib file (.dylib) which I need to include and load when the app opens.

Since I have never messed about with lib files in OSX, I wondering if anyone has used Spatialite before, or how best to get this lib file in use.

I dont know how to create a Xojo plugin with it, and Im a little apprehensive of messing about with the lib folder in OSX.

Any thoughts / recommendations ?

Hi, Windows user here…
Under Windows the SQLiteDatabase that comes with Xojo allow “load extension” to libspatialite.dll (a .dylib under OSX).
Under OSX, I believe You will need “homebrew”:

$ brew update
$ brew install libspatialite # 4.2.0
$ brew install spatialite-tools # 4.1.1

Then, in your app SQLiteDatabase:
SELECT load_extension(‘libspatialite.dylib’);

Thanks for the reply. The installation is not an issue, and I do indeed use homebrew.

It was the loading of the lib I needed to confirm.

I’ll give this a go, thanks.