RawrUniversal / xerial

Automatically exported from code.google.com/p/xerial
0 stars 1 forks source link

Include support for SpatiaLite #86

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
SpatiaLite provides spatial extensions to sqlite and requires an additional 
native library. However spatialite on its own is compiled similar to sqlitejdbc 
in that it includes its own copy of sqlite. Which leads to problems when the 
spatialite shared library is loaded as a regular sqlite extension.

So the solution was to compile spatialite directly into sqlitejdbc. This has 
the nice benefit of the user not having to worry about setting any 
configuration to load the spatialite library properly.

The attached patch adds a property to SQLiteConfig to enable spatialite. The 
patch is still a bit rough and imo still needs some work, mostly in the 
makefile:

* compiling spatiallite support should be optional and by default disabled
* spatialite can optionally be compiled against the the geos and proj 
libraries. There should be options to include spatialite without those libraries
* the Makefile changes for windows need to be cleaned up ...
* appropriate compile and links flags need to be added for 64 bit

If you think this is the right approach I am happy to implement the above 
changes and provide a new patch.

Original issue reported on code.google.com by jdeolive...@gmail.com on 9 Nov 2010 at 4:44

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

Clould this patch be used for windows, linux and Mac OS snow leopard
and archit 64 bits also?

Thanks,
mem

Original comment by emina.mo...@gmail.com on 19 Feb 2011 at 10:36

GoogleCodeExporter commented 8 years ago
It should be yes, but I have not really tested in on 64 bit. Also I am told 
that spatialite has other issues on windows 64 bit. But I have used it 
successfully for windows linux and osx 32 bit.

Original comment by jdeolive...@gmail.com on 19 Feb 2011 at 4:19

GoogleCodeExporter commented 8 years ago
could you please explain, how to proceed to apply this patch.
Thx in advance

Original comment by emina.mo...@gmail.com on 20 Feb 2011 at 10:49

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Well the easiest way to apply the patch would be to first clone the current 
sources. Then download the patch and apply it at the top level. Then build the 
sqlitejdbc sources as normal and the resulting jar should have both the sqlite 
and spatialite libs integrated into it.

Original comment by jdeolive...@gmail.com on 22 Feb 2011 at 5:15

GoogleCodeExporter commented 8 years ago
I've been trying to get this working on Ubuntu 10.04 64-bit will little success.

I get the following error:

/usr/bin/ld: target/sqlite-3.7.7.1-Linux-amd64/sqlite3.o: relocation 
R_X86_64_32 against `.rodata' can not be used when making a shared object; 
recompile with -fPIC

Which seems to be a problem building 32 bit software on a 64 bit machine.

Have anyone had any success with this?

Original comment by paul.dur...@dsto.defence.gov.au on 15 Sep 2011 at 12:10