Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Commented out broken radial location predicate in AssetQueryPredicate

Rich Turnerf87d42ea932a
diff --git a/manager/src/main/java/org/openremote/manager/rules/AssetQueryPredicate.java b/manager/src/main/java/org/openremote/manager/rules/AssetQueryPredicate.java
index b1a710e78..e80ceccda 100644
--- a/manager/src/main/java/org/openremote/manager/rules/AssetQueryPredicate.java
+++ b/manager/src/main/java/org/openremote/manager/rules/AssetQueryPredicate.java
@@ -214,17 +214,19 @@ public class AssetQueryPredicate implements Predicate<AssetState> {
protected Predicate<Coordinate> asPredicate(LocationPredicate predicate) {
return coordinate -> {
if (predicate instanceof RadialLocationPredicate) {
- RadialLocationPredicate radialLocationPredicate = (RadialLocationPredicate) predicate;
- GeometricShapeFactory shapeFactory = new GeometricShapeFactory();
- shapeFactory.setCentre(new Coordinate(radialLocationPredicate.lat, radialLocationPredicate.lng));
- shapeFactory.setSize(radialLocationPredicate.radius * 2);
- Polygon circle = shapeFactory.createCircle();
-
- GeometryFactory geometryFactory = new GeometryFactory();
- Point point = geometryFactory.createPoint(coordinate);
- return point.within(circle);
+ return false;
+ // TODO: Fix this
+// RadialLocationPredicate radialLocationPredicate = (RadialLocationPredicate) predicate;
+// GeometricShapeFactory shapeFactory = new GeometricShapeFactory();
+// shapeFactory.setCentre(new Coordinate(radialLocationPredicate.lat, radialLocationPredicate.lng));
+// shapeFactory.setSize(radialLocationPredicate.radius * 2);
+// Polygon circle = shapeFactory.createCircle();
+// GeometryFactory geometryFactory = new GeometryFactory();
+// Point point = geometryFactory.createPoint(coordinate);
+// return point.within(circle);
} else if (predicate instanceof RectangularLocationPredicate) {
+ // Again this is a euclidean plane so doesn't work perfectly for WGS lat/lng - the bigger the rectangle to less accurate it is)
RectangularLocationPredicate rectangularLocationPredicate = (RectangularLocationPredicate) predicate;
Envelope envelope = new Envelope(rectangularLocationPredicate.latMin,
rectangularLocationPredicate.lngMin,