骑行轨迹增加是否超出中国范围判断,过滤时序数据库中的异常轨迹数据
This commit is contained in:
parent
2fa824bcec
commit
441042b3c6
@ -58,7 +58,7 @@ public class CoordinateUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 国内范围判断
|
// 国内范围判断
|
||||||
private static boolean outOfChina(double lon, double lat) {
|
public static boolean outOfChina(double lon, double lat) {
|
||||||
return lon < 72.004 || lon > 137.8347 || lat < 0.8293 || lat > 55.8271;
|
return lon < 72.004 || lon > 137.8347 || lat < 0.8293 || lat > 55.8271;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,7 @@ public class EbikeTrackingServiceImpl implements EbikeTrackingService {
|
|||||||
fluxQuery.add(" |> pivot(rowKey: [\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")");
|
fluxQuery.add(" |> pivot(rowKey: [\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")");
|
||||||
QueryApi queryApi = influxDBClient.getQueryApi();
|
QueryApi queryApi = influxDBClient.getQueryApi();
|
||||||
List<EbikeTracking> points = queryApi.query(fluxQuery.toString(), EbikeTracking.class);
|
List<EbikeTracking> points = queryApi.query(fluxQuery.toString(), EbikeTracking.class);
|
||||||
return points.stream().map(point -> {
|
return points.stream().filter(point -> !CoordinateUtil.outOfChina(point.getLongitude(), point.getLatitude())).map(point -> {
|
||||||
EbikeTrackingDto ebikeTrackingDto = new EbikeTrackingDto();
|
EbikeTrackingDto ebikeTrackingDto = new EbikeTrackingDto();
|
||||||
BeanUtils.copyProperties(point, ebikeTrackingDto);
|
BeanUtils.copyProperties(point, ebikeTrackingDto);
|
||||||
Instant _time = point.get_time();
|
Instant _time = point.get_time();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user