骑行轨迹因为入库时GPS坐标已经转为GCJ02,获取的时候就不再转换
This commit is contained in:
parent
081dc26d85
commit
62e742edea
@ -86,14 +86,17 @@ public class EbikeTrackingServiceImpl implements EbikeTrackingService {
|
||||
fluxQuery.add(" |> pivot(rowKey: [\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")");
|
||||
QueryApi queryApi = influxDBClient.getQueryApi();
|
||||
List<EbikeTracking> points = queryApi.query(fluxQuery.toString(), EbikeTracking.class);
|
||||
return points.stream().filter(point -> !CoordinateUtil.outOfChina(point.getLongitude(), point.getLatitude())).map(point -> {
|
||||
return points.stream().map(point -> {
|
||||
EbikeTrackingDto ebikeTrackingDto = new EbikeTrackingDto();
|
||||
BeanUtils.copyProperties(point, ebikeTrackingDto);
|
||||
Instant _time = point.get_time();
|
||||
ebikeTrackingDto.setTime(ConvertUtil.instantToDatetime(_time));
|
||||
double[] gcj02 = CoordinateUtil.WGS84ToGCJ02(point.getLongitude(), point.getLatitude());
|
||||
ebikeTrackingDto.setLngGCJ02(gcj02[0]);
|
||||
ebikeTrackingDto.setLatGCJ02(gcj02[1]);
|
||||
// GPS入库的时候已经转为GCJ02坐标系
|
||||
ebikeTrackingDto.setLngGCJ02(point.getLongitude());
|
||||
ebikeTrackingDto.setLatGCJ02(point.getLatitude());
|
||||
//double[] gcj02 = CoordinateUtil.WGS84ToGCJ02(point.getLongitude(), point.getLatitude());
|
||||
//ebikeTrackingDto.setLngGCJ02(gcj02[0]);
|
||||
//ebikeTrackingDto.setLatGCJ02(gcj02[1]);
|
||||
return ebikeTrackingDto;
|
||||
}).toList();
|
||||
}else{
|
||||
|
||||
@ -30,6 +30,12 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>${boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-spring-boot3-starter</artifactId>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user