X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.app.geo%2Fsrc%2Forg%2Fargeo%2Fapp%2Fgeo%2Fhttp%2FWfsHttpHandler.java;h=641c14bbed9b4efc40ec6a57def5bf64257754c7;hb=9ef8eb23c32d4a09c688c2e493a6b891cb505f95;hp=59cb97a2d4eb02331f423b3b7ef302501c6f64d7;hpb=ee54891e28ea7af2623bfaa28bc4a1103bfc7c22;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.app.geo/src/org/argeo/app/geo/http/WfsHttpHandler.java b/org.argeo.app.geo/src/org/argeo/app/geo/http/WfsHttpHandler.java index 59cb97a..641c14b 100644 --- a/org.argeo.app.geo/src/org/argeo/app/geo/http/WfsHttpHandler.java +++ b/org.argeo.app.geo/src/org/argeo/app/geo/http/WfsHttpHandler.java @@ -216,11 +216,16 @@ public class WfsHttpHandler implements HttpHandler { if (bbox != null) { search.getWhere().any((or) -> { + // box overlap, see + // https://stackoverflow.com/questions/20925818/algorithm-to-check-if-two-boxes-overlap + // isOverlapping = (x1min < x2max AND x2min < x1max AND y1min < y2max AND y2min + // < y1max) + // x1 = entity, x2 = bbox or.all((and) -> { - and.gte(EntityName.minLat, bbox.getMinX()); - and.gte(EntityName.minLon, bbox.getMinY()); - and.lte(EntityName.maxLat, bbox.getMaxX()); - and.lte(EntityName.maxLon, bbox.getMaxY()); + and.lte(EntityName.minLat, bbox.getMaxX()); + and.gte(EntityName.maxLat, bbox.getMinX()); + and.lte(EntityName.minLon, bbox.getMaxY()); + and.gte(EntityName.maxLon, bbox.getMinY()); }); or.all((and) -> { and.gte(WGS84PosName.lat, bbox.getMinX()); @@ -362,7 +367,8 @@ public class WfsHttpHandler implements HttpHandler { generator.writeEnd();// features array generator.writeEnd().close(); - log.debug("GeoJSon encoding took " + (System.currentTimeMillis() - begin) + " ms."); + if (log.isTraceEnabled()) + log.trace("GeoJSon encoding took " + (System.currentTimeMillis() - begin) + " ms."); } protected Geometry getDefaultGeometry(Content content) {