Skip to content
Permalink
Browse files
[BUGFIX][Processing] Fix spatialite version comparison
  • Loading branch information
rldhont committed Apr 20, 2017
1 parent ca40e11 commit b35bbb628579762977e8533395d94a778cb8d853
Showing with 3 additions and 3 deletions.
  1. +3 −3 python/plugins/processing/algs/qgis/spatialite_utils.py
@@ -26,6 +26,7 @@
__revision__ = '$Format:%H$'

from pyspatialite import dbapi2 as sqlite
import re


class DbError(Exception):
@@ -64,11 +65,10 @@ def init_spatialite(self):
try:
self._exec_sql(c, u'SELECT spatialite_version()')
rep = c.fetchall()
v = [int(a) for a in rep[0][0].split('.')]
vv = v[0] * 100000 + v[1] * 1000 + v[2] * 10
v = [int(x) if x.isdigit() else x for x in re.findall("\d+|[a-zA-Z]+", rep[0][0])]

# Add spatialite support
if vv >= 401000:
if v >= [4, 1, 0]:
# 4.1 and above
sql = "SELECT initspatialmetadata(1)"
else:

0 comments on commit b35bbb6

Please sign in to comment.