- geom = self.context.osm.parse_geometry(expected, self.context.scene)
- with self.context.db.cursor() as cur:
- cur.execute("""SELECT ST_Equals(ST_SnapToGrid({}, 0.00001, 0.00001),
- ST_SnapToGrid(ST_SetSRID('{}'::geometry, 4326), 0.00001, 0.00001))""".format(
- geom, self.db_row['geomtxt']))
+ geom = self.context.osm.parse_geometry(expected)
+ with self.context.db.cursor(row_factory=psycopg.rows.tuple_row) as cur:
+ cur.execute(pysql.SQL("""SELECT ST_Equals(ST_SnapToGrid({}, 0.00001, 0.00001),
+ ST_SnapToGrid(ST_SetSRID({}::geometry, 4326), 0.00001, 0.00001))""")
+ .format(pysql.SQL(geom),
+ pysql.Literal(self.db_row['geomtxt'])))