Refs #25645 -- Removed SpatiaLite 3.x compatibility in gis.db.models.functions.Translate.
Complements 47f22e8286
.
This commit is contained in:
parent
267dc4addd
commit
cee534228c
|
@ -435,12 +435,9 @@ class Transform(GeoFunc):
|
||||||
|
|
||||||
class Translate(Scale):
|
class Translate(Scale):
|
||||||
def as_sqlite(self, compiler, connection):
|
def as_sqlite(self, compiler, connection):
|
||||||
func_name = connection.ops.spatial_function_name(self.name)
|
if len(self.source_expressions) < 4:
|
||||||
if func_name == 'ST_Translate' and len(self.source_expressions) < 4:
|
# Always provide the z parameter for ST_Translate
|
||||||
# Always provide the z parameter for ST_Translate (Spatialite >= 3.1)
|
|
||||||
self.source_expressions.append(Value(0))
|
self.source_expressions.append(Value(0))
|
||||||
elif func_name == 'ShiftCoords' and len(self.source_expressions) > 3:
|
|
||||||
raise ValueError("This version of Spatialite doesn't support 3D")
|
|
||||||
return super(Translate, self).as_sqlite(compiler, connection)
|
return super(Translate, self).as_sqlite(compiler, connection)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue