Skip to content

Commit 3dbcccc

Browse files
Merge pull request #53 from mkeller3/sql_bbox
Update for bbox sql
2 parents 7a44bb3 + 76f4c31 commit 3dbcccc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pygeofilter/backends/sql/evaluate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ def spatial_operation(self, node, lhs, rhs):
121121
@handle(ast.BBox)
122122
def bbox(self, node, lhs):
123123
func = SPATIAL_COMPARISON_OP_MAP[ast.SpatialComparisonOp.INTERSECTS]
124-
# TODO: create BBox geometry
125-
rhs = ""
124+
rhs = f"ST_GeomFromText('POLYGON(({node.minx} {node.miny}, {node.minx} {node.maxy}, {node.maxx} {node.maxy}, {node.maxx} {node.miny}, {node.minx} {node.miny}))')"
126125
return f"{func}({lhs},{rhs})"
127126

128127
@handle(ast.Attribute)

0 commit comments

Comments
 (0)