I am using the following code to retrieve nodes that fall within a boundary.
bounds is supplied by google maps.
Envelope bbox = new Envelope(bounds.lngNortheast, bounds.lngSouthwest, bounds.latNortheast, bounds.latSouteWest);
Geometry geometry = spatialLayer.getGeometryFactory().toGeometry(bbox);
GeoPipeline results = GeoPipeline.startWithinSearch(spatialLayer, geometry);
This works well when both west and east are within the same hemisphere (western or eastern).
However, when I try to load nodes that fall across hemispheres the Envelope sorts them to always include lng 0 instead of lng 180
For instance a map showing japan and US will load nodes from europe but not from hawaii.
Is there a way to retrieve an area that crosses 180 (I can always fall back to retrieve it as two separate areas but would like to avoid thinking about it if possible).
Yuval