I have below query which I am supposed to import into QGIS by amending certain aspects, to find out exactly what it does. But when I try to run it on the corresponding PostGIS layer, DB Manager warns me that there is not such "geom" attribute. I don't know what to do then. Is it a syntax issue?
UPDATE c_risque.ppr_inondation_surf
SET geom = st_multi(st_simplify(st_multi(st_collectionextract(st_forcecollection(st_makevalid(st_snaptogrid(geom, 1))),3)),0))
WHERE not st_equals(geom, st_multi(st_simplify(st_multi(st_collectionextract(st_forcecollection(st_makevalid(st_snaptogrid(geom, 1))),3)),0)));
c_risque.ppr_inondation_surf
actually have a column namedgeom
? Also, consider this: you test each rows geometry for<complicated_geometric_processing>
, and if it's not equal, do and setcomplicated_geometric_processing>
; while that seems to make sense, it would be faster to just set everything to<complicated_geometric_processing>
(except you'd have a functional index on<complicated_geometric_processing>
...which you likely don't want). – geozelot Dec 26 '19 at 18:29