fixed distance calculation

This commit is contained in:
Christopher Moyer 2023-01-04 18:30:44 -05:00
parent f5a97fa9c6
commit 3e8b0bcf56

View file

@ -68,7 +68,7 @@ public class CamelConfiguration extends RouteBuilder {
.filter(exchange -> exchange.getIn().getBody(JsoCall.class).getPoint() != null) .filter(exchange -> exchange.getIn().getBody(JsoCall.class).getPoint() != null)
.process(exchange -> { .process(exchange -> {
JsoCall jsoCall = exchange.getIn().getBody(JsoCall.class); JsoCall jsoCall = exchange.getIn().getBody(JsoCall.class);
if (Point2D.distance(jsoCall.getPoint().getLat(), appProperties.myLat(), jsoCall.getPoint().getLng(), appProperties.myLong()) if (Point2D.distance(jsoCall.getPoint().getLat(), jsoCall.getPoint().getLng(), appProperties.myLat(), appProperties.myLong())
>= appProperties.telegramNotificationThreshold()) { >= appProperties.telegramNotificationThreshold()) {
exchange.setRouteStop(true); exchange.setRouteStop(true);
} }