添加经纬度纠偏逻辑,但是仅简单甄别问题点,无法纠正

This commit is contained in:
tongchenfei
2020-12-01 14:50:04 +08:00
parent 2eaf96533d
commit 0dc442100b
5 changed files with 233 additions and 15 deletions

View File

@@ -3,6 +3,8 @@ package com.mogo.module.common.entity;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Objects;
/**
* 云端定位信息和自车定位信息
*
@@ -17,7 +19,17 @@ public class CloudLocationInfo implements Parcelable {
private double alt;
private double speed;
public CloudLocationInfo(){
public CloudLocationInfo() {
}
public CloudLocationInfo(CloudLocationInfo info) {
this.lat = info.getLat();
this.lon = info.getLon();
this.heading = info.getHeading();
this.systemTime = System.currentTimeMillis();
this.satelliteTime = System.currentTimeMillis();
this.alt = info.alt;
this.speed = info.speed;
}
protected CloudLocationInfo(Parcel in) {
@@ -126,4 +138,27 @@ public class CloudLocationInfo implements Parcelable {
", speed=" + speed +
'}';
}
public String print() {
return "CloudLocation{ lon: " + lon + " lat: " + lat + " heading: " + heading + " speed: "
+ speed+"}";
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudLocationInfo that = (CloudLocationInfo) o;
return Double.compare(that.lat, lat) == 0 &&
Double.compare(that.lon, lon) == 0;
}
@Override
public int hashCode() {
return Objects.hash(lat, lon);
}
}