Skip to content

Commit 2d2ad00

Browse files
committed
fixed BBOX query
1 parent 316ac39 commit 2d2ad00

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

citydb-query/src/main/java/org/citydb/query/builder/sql/SpatialPredicateBuilder.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,19 @@ private BuildResult build(BinarySpatialPredicate predicate, Select select, SqlCo
8181
&& rightOperand.getExpression() instanceof ScalarExpression rightExpression) {
8282
SpatialOperator operator = negate(predicate.getOperator(), negate);
8383
negate = negate ^ operator != predicate.getOperator();
84-
boolean requiresTransformation = false;
8584

8685
SpatialObject leftLiteral = helper.getSpatialLiteral(predicate.getLeftOperand());
8786
if (leftLiteral != null && helper.getOrSetSRID(leftLiteral, filterSrs) != databaseSrs.getSRID()) {
8887
leftExpression = helper.getSpatialOperationHelper().transform(leftExpression, databaseSrs.getSRID());
89-
requiresTransformation = true;
9088
}
9189

9290
SpatialObject rightLiteral = helper.getSpatialLiteral(predicate.getRightOperand());
9391
if (rightLiteral != null && helper.getOrSetSRID(rightLiteral, filterSrs) != databaseSrs.getSRID()) {
9492
rightExpression = helper.getSpatialOperationHelper().transform(rightExpression, databaseSrs.getSRID());
95-
requiresTransformation = true;
9693
}
9794

9895
BooleanExpression expression;
99-
if (!requiresTransformation
100-
&& leftOperand.getType() == Type.ENVELOPE
96+
if (leftOperand.getType() == Type.ENVELOPE
10197
&& rightOperand.getType() == Type.ENVELOPE
10298
&& (operator == SpatialOperator.INTERSECTS
10399
|| operator == SpatialOperator.DISJOINT)) {

0 commit comments

Comments
 (0)