Hi all,
I was thinking how to improve situation with pyspatialite and spatialite 4
incompatibility. I have found that loading dynamic libspatialite module
instead pyspatialite is easier than I thought, at least in Ubuntu 12.04.
Here is working code example (python-pysqlite2 required):
from pysqlite2 import dbapi2 as sqlite3
conn = sqlite3.connect(":memory:")
conn.enable_load_extension(True)
cur = conn.cursor()
cur.execute("SELECT load_extension('libspatialite.so.5')")
cur.execute("SELECT ST_Length(ST_GeometryFromText('LINESTRING(30 10,
10 30, 40 40)'))")
print cur.fetchone()[0]
conn.close()
Has anybody tried to replace pyspatialite with python-pysqlite2 and dynamic
libspatialite loading ?
--
Ivan Minčík
[email protected] GPG: 0x79529A1E
http://imincik.github.io/0x79529A1E.key
[email protected] GPG: 0xD714B02C
http://imincik.github.io/0xD714B02C.key
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer