[Geoserver-users] New SpatiaLite JDBC fork

Hi,

The new SpatiaLite 4.2.1 driver is now working with Geoserver 2.6 on OS X. Please help to get this ported to other platforms as well. I’ve copy pasted an update to the previous spatialite documentation. It shouldn’t be too hard to get it working on Windows as well, since the new Spatialite is based on autoconfig and there are not too many dependencies to resolve.

I hope the driver will work stand-alone, it’s linked statically agains all libraries. But I did not yet test for hidden linkages.

OS X install instructions:

Regards
Ben

PS: The updated documentation (rough draft, done a bit in a hurry):

Spatialite4 Output Format Documentation

As prerequisite, we first need to build the appropriate libraries
For Windows 64-bits we need:

  • Just download the lastest version.
  • Execute the installer.
  • In repository catalogues, check “Download lastest repository”
  • In select components select all options exept “MinGW Developer Toolkit”

And now we let’s start to build libraries:
#ref = http://www.gaia-gis.it/spatialite-2.4.0/mingw_how_to.html (Steps 1, 6, 8 and 9)

  • First of all, we need to execute MSYS.bat, located at /path/to/mingw/msys/1.0/msys.bat.
  • Building PROJ.4 :
  • Building GEOS :
  • including LIBICONV :
  • just copy the ziped files (Binaries and Developer) into /path/to/minwg/msys/1.0/local

Now we’re ready to actually build SpatiaLite4 JDBC:

  • Install and configure (Check if the directory is in the PATH environment variable) Maven2 (or highter). #url = http://maven.apache.org/
  • Install and configure (Check if the directory is in the PATH environment variable) Mercurial (hg). #url = http://mercurial.selenic.com
  • Wither git clone spatialite4-jdbc, or simply download the repository (“Download ZIP”) from Github (spatialite4 branch):
  • Go inside the root of spatialite4-jdbc and run:
  • make
  • When finished, go inside “target” directory and search for “spatialite4-jdbc-($version)-SNAPSHOT.jar” (This one is the JDBC for our SO).

The makefile builds and configures both SpatiaLite and SQLite, and runs a test after successful build. If all tests pass, everything should be fine and you can copy the .jar file to it’s destined location.

Hi Benjamin,

Have you considered to make SpatiaLite driver so that SpatiaLite would be loaded as a dynamic extension https://www.gaia-gis.it/fossil/libspatialite/wiki?name=mod_spatialite? At least update to next SpatiaLite versions should be easier then because only the native “mod_spatialite” component needs to be updated. Or is there something in the Spatialite driver that would not work if Spatialite were loaded as an extension?

-Jukka Rahkonen-

···

Stadin, Benjamin wrote:

Hi,

The new SpatiaLite 4.2.1 driver is now working with Geoserver 2.6 on OS X. Please help to get this ported to other platforms as well. I’ve copy pasted an update to the previous spatialite documentation. It shouldn’t be too hard to get it working on Windows as well, since the new Spatialite is based on autoconfig and there are not too many dependencies to resolve.

I hope the driver will work stand-alone, it’s linked statically agains all libraries. But I did not yet test for hidden linkages.

OS X install instructions:

Regards
Ben

PS: The updated documentation (rough draft, done a bit in a hurry):

Spatialite4 Output Format Documentation

As prerequisite, we first need to build the appropriate libraries
For Windows 64-bits we need:

  • Just download the lastest version.
  • Execute the installer.
  • In repository catalogues, check “Download lastest repository”
  • In select components select all options exept “MinGW Developer Toolkit”

And now we let’s start to build libraries:
#ref = http://www.gaia-gis.it/spatialite-2.4.0/mingw_how_to.html (Steps 1, 6, 8 and 9)

  • First of all, we need to execute MSYS.bat, located at /path/to/mingw/msys/1.0/msys.bat.
  • Building PROJ.4 :
  • Building GEOS :
  • including LIBICONV :
  • just copy the ziped files (Binaries and Developer) into /path/to/minwg/msys/1.0/local

Now we’re ready to actually build SpatiaLite4 JDBC:

  • Install and configure (Check if the directory is in the PATH environment variable) Maven2 (or highter). #url = http://maven.apache.org/
  • Install and configure (Check if the directory is in the PATH environment variable) Mercurial (hg). #url = http://mercurial.selenic.com
  • Wither git clone spatialite4-jdbc, or simply download the repository (“Download ZIP”) from Github (spatialite4 branch):
  • Go inside the root of spatialite4-jdbc and run:
  • make
  • When finished, go inside “target” directory and search for “spatialite4-jdbc-($version)-SNAPSHOT.jar” (This one is the JDBC for our SO).

The makefile builds and configures both SpatiaLite and SQLite, and runs a test after successful build. If all tests pass, everything should be fine and you can copy the .jar file to it’s destined location.

Hi Jukka,

Yes, I’ve considered this (I also came across this site). In general, the SQLite extension loading mechanism works very well. I’ve implemented some SQLite extensions before.

The driver could be changed easily to use mod_spatialite instead of the static library. But I dislike one thing about mod_spatialite - the same reasons for which xerial decided to embed SQLite into the driver (authors of the SQLite JDBC library): Dynamic linkage and manual configurations are very error prone to the user with a JDBC driver.
For an example, It took me some time to get all libraries right on my system. Some libs were absent or had a wrong version, or need to be recompiled some config option in a latest version changed and. It get’s worse when a user has to figure what’s wrong when the JDBC module just doesn’t work – it’s hard to debug even for developers.

So in my opinion a JDBC driver must embed as much as possible and preferably work out of the box. I otherwise agree with the SpatiaLite developers when no Java / JNI is involved.

  • Ben
···

Stadin, Benjamin wrote:

Hi,

The new SpatiaLite 4.2.1 driver is now working with Geoserver 2.6 on OS X. Please help to get this ported to other platforms as well. I’ve copy pasted an update to the previous spatialite documentation. It shouldn’t be too hard to get it working on Windows as well, since the new Spatialite is based on autoconfig and there are not too many dependencies to resolve.

I hope the driver will work stand-alone, it’s linked statically agains all libraries. But I did not yet test for hidden linkages.

OS X install instructions:

Regards
Ben

PS: The updated documentation (rough draft, done a bit in a hurry):

Spatialite4 Output Format Documentation

As prerequisite, we first need to build the appropriate libraries
For Windows 64-bits we need:

  • Just download the lastest version.
  • Execute the installer.
  • In repository catalogues, check “Download lastest repository”
  • In select components select all options exept “MinGW Developer Toolkit”

And now we let’s start to build libraries:
#ref = http://www.gaia-gis.it/spatialite-2.4.0/mingw_how_to.html (Steps 1, 6, 8 and 9)

  • First of all, we need to execute MSYS.bat, located at /path/to/mingw/msys/1.0/msys.bat.
  • Building PROJ.4 :
  • Building GEOS :
  • including LIBICONV :
  • just copy the ziped files (Binaries and Developer) into /path/to/minwg/msys/1.0/local

Now we’re ready to actually build SpatiaLite4 JDBC:

  • Install and configure (Check if the directory is in the PATH environment variable) Maven2 (or highter). #url = http://maven.apache.org/
  • Install and configure (Check if the directory is in the PATH environment variable) Mercurial (hg). #url = http://mercurial.selenic.com
  • Wither git clone spatialite4-jdbc, or simply download the repository (“Download ZIP”) from Github (spatialite4 branch):
  • Go inside the root of spatialite4-jdbc and run:
  • make
  • When finished, go inside “target” directory and search for “spatialite4-jdbc-($version)-SNAPSHOT.jar” (This one is the JDBC for our SO).

The makefile builds and configures both SpatiaLite and SQLite, and runs a test after successful build. If all tests pass, everything should be fine and you can copy the .jar file to it’s destined location.