#1990 Ignores GPS positions with 0/0 latitude and longitude values.

This commit is contained in:
sheirerd
2024-09-22 09:46:11 -04:00
parent 5d4dff7948
commit 55b20c75c0
3 changed files with 54 additions and 38 deletions

View File

@@ -87,17 +87,20 @@ public class PlottableEntityHistory
*/
public void add(PlottableDecodeEvent event)
{
TimestampedGeoPosition mostRecentPosition = getLatestPosition();
TimestampedGeoPosition latest = new TimestampedGeoPosition(event.getLocation(), event.getTimeStart());
if(isUnique(latest, mostRecentPosition))
if(event.isValidLocation())
{
mCurrentEvent = event;
mLocationHistory.add(0, latest);
TimestampedGeoPosition mostRecentPosition = getLatestPosition();
TimestampedGeoPosition latest = new TimestampedGeoPosition(event.getLocation(), event.getTimeStart());
while(mLocationHistory.size() > MAX_LOCATION_HISTORY)
if(isUnique(latest, mostRecentPosition))
{
mLocationHistory.remove(mLocationHistory.size() - 1);
mCurrentEvent = event;
mLocationHistory.add(0, latest);
while(mLocationHistory.size() > MAX_LOCATION_HISTORY)
{
mLocationHistory.remove(mLocationHistory.size() - 1);
}
}
}
}