-
-
-class ST_DWithin(sa.sql.functions.GenericFunction[Any]):
- name = 'ST_DWithin'
- inherit_cache = True
-
-
-@compiles(ST_DWithin, 'sqlite') # type: ignore[no-untyped-call, misc]
-def default_json_array_each(element: SaColumn, compiler: 'sa.Compiled', **kw: Any) -> str:
- geom1, geom2, dist = list(element.clauses)
- return "(MbrIntersects(%s, ST_Expand(%s, %s)) = 1 AND ST_Distance(%s, %s) <= %s)" % (
- compiler.process(geom1, **kw), compiler.process(geom2, **kw),
- compiler.process(dist, **kw),
- compiler.process(geom1, **kw), compiler.process(geom2, **kw),
- compiler.process(dist, **kw))