Skip to content

Conversation

@utas-raymondng
Copy link
Collaborator

Fix bug where any input value from frontend will be handle correctly by the CQL BBOX by adjust it within [-180, 180], geo_bounding_box in elastic require bbox to work within this range

Comment on lines +36 to +43
if(maxx >= 0 && maxx <= 180) {
// Normal case
polygons.add((Polygon)createBoxPolygon(minx, maxx, miny, maxy));
}
else {
polygons.add((Polygon)createBoxPolygon(minx, 180, miny, maxy));
polygons.add((Polygon)createBoxPolygon(-180, maxx, miny, maxy));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you call createBoxPolygon and cast the result to Polygon, can we make return type of createBoxPolygon to Polygon with validating valid polygon?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can

@vietnguyengit vietnguyengit merged commit 0a9e6e8 into main Dec 9, 2024
2 checks passed
@vietnguyengit vietnguyengit deleted the bugs/5953-bug-bbox branch December 9, 2024 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants