Spatialite GUI on Enterprise Linux 6 systems

Continuing my last post on using the spatialite tools and software on EL 6 and clones, here’s how I got the spatialite_gui to work.

The Spatialite collection of software includes the core library, libspatialite, a simple GIS viewer spatialite-gis and a GUI program for managing sqlite based spatial databases: spatialite_gui. The version 2.3.1 is called “stable”, but 2.4.0 has been out for almost a year now, and 3.0 is already on the horizon. Here we’re looking at the 2.4.0 version There are binaries in the downloads website, including for x86_64 systems, but I couldn’t get them to work since they are, it seems, built against newer versions of the geos and geotiff libraries than come packaged for Enterprise Linux. Keeping with the policy of installing as much as possible thru yum, and doing compiling only when necessary, we’ll leave the system geos and geotiff alone, and go for a homemade spatialite_gui. I downloaded the sources for three packages from the spatialite 2.4.0 download page: spatialite-tools, spatialite_gui and libgaiagraphics.

First comes the requisite libgaiagraphics. Unpack the tarball and drop into its directory. This library needs to find the geotiff header files, so you must have libgeotiff-devel installed through yum. In addition the geotiff  headers on Fedora and EL systems get put into a subdirectory  /usr/include/libgeotiff, so for the configure step to find these needed headers first create a CPPFLAGS environment variable then run the usual compile steps as:
export CPPFLAGS="-I/usr/include/libgeotiff"
./configure
make

and as root do
make install

Next untar the spatialite_gui package and go into its directory. We’ll need sqlite headers for this step so be sure you have done yum install sqlite-devel. But here I found one glitch. It seems that the sqlite3 header file, /usr/include/sqlite3.h as installed on EL6 is lacking one #define statement that causes the compilation of spatialte_gui to fail. So as root, edit /usr/include/sqlite3.h and add
#define SQLITE_STMTSTATUS_AUTOINDEX 3
after line 5272.
Now you’re ready to do ./configure && make
And running make install as root will drop the new spatialite_gui binary into /usr/local/bin.

Finally open spatialite-tools and go thru the same three configure and compile steps. This worked without issues for me, leaving the suite of tools in /usr/local/bin. If you want an icon for a desktop or menu shortcut, it’ll be in your download directory under spatialite_gui-1.4.0/icons…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>