From 157474fd6d3aa2c028e17569d1a081c370db5182 Mon Sep 17 00:00:00 2001 From: rng Date: Thu, 26 Jun 2025 08:50:19 +1000 Subject: [PATCH] Further rollback change as it seems original is faster --- .../server/core/parser/stac/GeometryVisitor.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/parser/stac/GeometryVisitor.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/parser/stac/GeometryVisitor.java index 266da83b..d7f3668f 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/parser/stac/GeometryVisitor.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/parser/stac/GeometryVisitor.java @@ -118,13 +118,14 @@ public Object visit(BBOX filter, Object data) { if(filter instanceof BBoxImpl impl) { if(impl.getGeometry() != null && (data instanceof Polygon || data instanceof GeometryCollection)) { Geometry input = (Geometry) data; - try { - return impl.getGeometry().intersection(input); - } - catch(Exception e) { - // buffer is expensive to fix invalid geometry, call it only if needed - return impl.getGeometry().intersection(input.buffer(0.0)); - } + // buffer is expensive but turns out it is faster in most case by doing it instead of using try catch + // try { + // return impl.getGeometry().intersection(input); + // } + // catch(Exception e) { + // return impl.getGeometry().intersection(input.buffer(0.0)); + //} + return impl.getGeometry().intersection(input.buffer(0.0)); } else { return data;