[GIS] spatialite – azimuth function not available

azimuthspatialiteUbuntuwindows

I am working with last spatialite versions on both Windows (7) and Ubuntu (13.10).

I installed these from reference spatialite website. For both, version that I downloaded is 4.1.1 (nevertheless in Ubuntu, at spatialite start up, i get a version number : 4.1.0 ; I assume this is a little bug)

Details on the packages :

  • binaries for windows: spatialite-4.1.1-win-x86.zip
  • source for ubuntu: libspatialite-4.1.1.tar.gz and all other usefull ressources

I then developped a sql script on windows, notably using azimuth /st_azimuth
this works fine on this OS. I have problems when I use it on Ubuntu and get the following error:

no such function: Azimuth

after some search, I undesrtood that this could be related to a missing lib: liblwgeom.

I had some more search to get this lib installed properly (at least no error message at the end) using the procedure described here (I effectively did the make and make install), but this does not seem to help.

Questions:

  • is the "wrong" version number for spatialite 4.1.1 a known bug?
  • is the missing Azimuth a know problem (i could not find any info)
  • is installing liblwgeom the solution to my probleĆ¹m ?
  • how to know if the liblwgeom install properly working ?
  • what may I have missed in the process ?

Thanks for your help and pieces of advice

Best Answer

Answer from Sandro Fueri, posted on the spatialite users group https://groups.google.com/forum/#!topic/spatialite-users/wx0RAFTA2tM

Hi Pascal,

the most recent versions of SpatiaLite support several interesting "advanced" functions based on LWGEOM: ST_Azimuth(), ST_MakeValid(), ST_Split() and so on. anyway enabling or not LWGEOM is a configurable option; and the default setting is --disable-lwgeom=yes (i.e. always disable LWGEOM, if not explicitly required)

the liblwgeom library is a self-standing independent module, but it isn't directly available as such. it is integral part of PostGIS, and the unique supported way to get liblwgeom installed (or built) is the one to install (or build) a very recent version of PostGIS (v.2.0 or v.2.1)

if you wish to get a full fledged version of libspatialite-4.1.1 on any Linux system you have to accomplish the following steps: - install (or build) PostGIS 2.x - install (or build) libxml2 - configure and then build libspatialite-4.1.1 by enabling both lwgeom and libxml2

./configure --enable-lwgeom=yes --enable-libxml2=yes make sudo make-install

PLEASE NOTE WELL: liblwgeom is released under the GPL licence; due to cross-license constraints, building libspatialite with liblwgeom enabled make libspatialite (and any further sw depending on libspatialite) to become implicitly GPLed.

bye Sandro

Related Question