I have a geopackage table/layer of buildings. I need to "offset" by using ST_Translate. https://postgis.net/docs/ST_Translate.html
The expression SELECT ST_Translate(geom, 1, 1, 0) FROM "building_UTM"
works when ran in the SQL Window of the DB Manager.
However, if the same expression is ran via the Query Builder/Filter function, it doesn't work and returns the following error
An error occurred when executing the query.The data provider said: OGR[3] error 1: Undefined function 'ST_Translate' used.
I'm sure that this expression ran as expected in the Query Builder in my other laptop.
translate()
works. I'm supposed to use the SQL expression in a PyQGIS script by putting it in theQgsVectorLayer.setSubsetString()
. The other option is theQgsVectorLayer.translateFeature()
method but it requires the layer to be in edit mode first.