From: Mathieu Baudier Date: Mon, 25 Sep 2023 11:43:45 +0000 (+0200) Subject: Improve WFS queries X-Git-Tag: v2.3.16~19 X-Git-Url: http://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=commitdiff_plain;h=d76ddbc151846278fabe03f5e5dcbbca94704ba5 Improve WFS queries --- diff --git a/org.argeo.app.geo/src/org/argeo/app/api/geo/FeatureAdapter.java b/org.argeo.app.geo/src/org/argeo/app/api/geo/FeatureAdapter.java index d00a2c0..03ca1ce 100644 --- a/org.argeo.app.geo/src/org/argeo/app/api/geo/FeatureAdapter.java +++ b/org.argeo.app.geo/src/org/argeo/app/api/geo/FeatureAdapter.java @@ -17,6 +17,17 @@ public interface FeatureAdapter { default Geometry getDefaultGeometry(Content c, QName targetFeature) { // TODO deal with more defaults // TODO deal with target feature + if (c.hasContentClass(EntityType.geopoint)) { + return getGeoPointGeometry(c); + } + return null; + } + + void writeProperties(JsonGenerator g, Content content, QName targetFeature); + + void addConstraintsForFeature(AndFilter filter, QName targetFeature); + + static Geometry getGeoPointGeometry(Content c) { if (c.hasContentClass(EntityType.geopoint)) { double latitude = c.get(WGS84PosName.lat, Double.class).get(); double longitude = c.get(WGS84PosName.lon, Double.class).get(); @@ -27,8 +38,4 @@ public interface FeatureAdapter { } return null; } - - void writeProperties(JsonGenerator g, Content content, QName targetFeature); - - void addConstraintsForFeature(AndFilter filter, QName targetFeature); } 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 2a63757..ae2940c 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 @@ -117,8 +117,7 @@ public class WfsHttpHandler implements HttpHandler { if (cql != null) { CqlUtils.filter(search.from(path), cql); } else { - search.from(path).where((and) -> { - }); + search.from(path); } // search.getWhere().any((f) -> { for (QName typeName : typeNames) {