switch reverse() to new Geometry datatype

Also switches to using bind parameters for recurring parameters.
This commit is contained in:
Sarah Hoffmann
2023-06-25 14:02:00 +02:00
parent 4bb4db0668
commit 6c4c9ec1f2
8 changed files with 127 additions and 100 deletions

View File

@@ -48,6 +48,9 @@ class Geometry(types.UserDefinedType[Any]):
class comparator_factory(types.UserDefinedType.Comparator):
def intersects(self, other: SaColumn) -> SaColumn:
return self.op('&&')(other)
def is_line_like(self) -> SaColumn:
return sa.func.ST_GeometryType(self, type_=sa.String).in_(('ST_LineString',
'ST_MultiLineString'))