I have a DB full of objects that contain a location (usually a polygon). I have a query defined that uses Hibernate Spatial's intersects() method to find all the objects that are with a box that's passed in (using SRID 4326, so it has lat/long coordinates).
The problem I'm having is that if the box contains the antimeridian it returns the objects as though the box was wrapped around the world, not the antimeridian.
For example: if I have a box with the top left (long, lat) coordinate of (170, 50), and a bottom right coordinate of (-170, 30), it treats it as though the top left coordinate is (-170, 50) and the bottom right coordinate is (170, 30).
How can I tell it that it should wrap around the antimeridian so that it returns the correct objects?