19 package org.sleuthkit.autopsy.geolocation;
21 import java.util.ArrayList;
22 import java.util.List;
24 import java.util.logging.Level;
33 import org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
65 filters.getDataSources(),
66 filters.getArtifactTypes(),
67 filters.showAllWaypoints(),
68 filters.getMostRecentNumDays(),
69 filters.showWaypointsWithoutTimeStamp(),
84 List<Set<MapWaypoint>> areas,
boolean wasEntirelySuccessful);
89 if (filters.getArtifactTypes().contains(ARTIFACT_TYPE.TSK_GPS_TRACK)) {
92 }
catch (GeoLocationDataException ex) {
93 logger.log(Level.WARNING,
"Exception thrown while retrieving list of Tracks", ex);
98 if (filters.getArtifactTypes().contains(ARTIFACT_TYPE.TSK_GPS_AREA)) {
101 }
catch (GeoLocationDataException ex) {
102 logger.log(Level.WARNING,
"Exception thrown while retrieving list of Areas", ex);
108 (trackResults == null) ?
new ArrayList<>() : trackResults.
getItems(),
109 (areaResults == null) ?
new ArrayList<>() : areaResults.
getItems());
112 final Set<MapWaypoint> pointSet =
MapWaypoint.getWaypoints(geoDataSet.getWaypoints());
113 final List<Set<MapWaypoint>> trackSets =
new ArrayList<>();
114 for (List<Waypoint> t : geoDataSet.getTracks()) {
117 final List<Set<MapWaypoint>> areaSets =
new ArrayList<>();
118 for (List<Waypoint> t : geoDataSet.getAreas()) {
123 pointSet, trackSets, areaSets,
140 private GeoDataSet
createWaypointList(List<Waypoint> waypoints, List<Track> tracks, List<Area> areas) {
141 final List<Waypoint> completeList =
new ArrayList<>();
142 List<List<Waypoint>> filteredTracks =
new ArrayList<>();
143 List<List<Waypoint>> filteredAreas =
new ArrayList<>();
145 if (tracks != null) {
148 if (!filters.showAllWaypoints()) {
152 timeRangeStart = timeRangeEnd - (86400 * filters.getMostRecentNumDays());
157 for (List<Waypoint> filteredTrack : filteredTracks) {
158 completeList.addAll(filteredTrack);
161 completeList.addAll(waypoints);
162 for (
Track track : tracks) {
163 completeList.addAll(track.getPath());
164 filteredTracks.add(track.getPath());
168 completeList.addAll(waypoints);
172 for (
Area area : areas) {
173 completeList.addAll(area.getPath());
174 filteredAreas.add(area.getPath());
177 return new GeoDataSet(completeList, filteredTracks, filteredAreas);
189 private List<Waypoint>
getWaypointsInRange(Long timeRangeStart, Long timeRangeEnd, List<Waypoint> waypoints) {
190 List<Waypoint> completeList =
new ArrayList<>();
192 if (waypoints != null) {
194 Long time = point.getTimestamp();
195 if ((time == null && filters.showWaypointsWithoutTimeStamp())
196 || (time != null && (time >= timeRangeStart && time <= timeRangeEnd))) {
198 completeList.add(point);
217 private List<List<Waypoint>>
getTracksInRange(Long timeRangeStart, Long timeRangeEnd, List<Track> tracks) {
218 List<List<Waypoint>> ret =
new ArrayList<>();
219 if (tracks != null) {
220 for (
Track track : tracks) {
221 Long trackTime = track.getStartTime();
223 if ((trackTime == null && filters.showWaypointsWithoutTimeStamp())
224 || (trackTime != null && (trackTime >= timeRangeStart && trackTime <= timeRangeEnd))) {
225 ret.add(track.getPath());
241 Long mostRecent = null;
244 if (mostRecent == null) {
245 mostRecent = point.getTimestamp();
247 mostRecent = Math.max(mostRecent, point.getTimestamp());
262 Long mostRecent = null;
264 for (
Track track : tracks) {
265 if (mostRecent == null) {
266 mostRecent = track.getStartTime();
267 }
else if (track.getStartTime() != null) {
268 mostRecent = Math.max(mostRecent, track.getStartTime());
288 if (waypointMostRecent != null && trackMostRecent != null) {
289 return Math.max(waypointMostRecent, trackMostRecent);
290 }
else if (waypointMostRecent == null && trackMostRecent != null) {
291 return trackMostRecent;
292 }
else if (waypointMostRecent != null && trackMostRecent == null) {
293 return waypointMostRecent;
302 static class GeoDataSet {
303 private final List<Waypoint> waypoints;
304 private final List<List<Waypoint>> tracks;
305 private final List<List<Waypoint>> areas;
307 GeoDataSet(List<Waypoint> waypoints, List<List<Waypoint>> tracks, List<List<Waypoint>> areas) {
308 this.waypoints = waypoints;
309 this.tracks = tracks;
313 List<Waypoint> getWaypoints() {
317 List<List<Waypoint>> getTracks() {
321 List<List<Waypoint>> getAreas() {
GeoDataSet createWaypointList(List< Waypoint > waypoints, List< Track > tracks, List< Area > areas)
static GeoLocationParseResult< Track > getTracks(SleuthkitCase skCase, List<?extends Content > sourceList)
void process(GeoLocationParseResult< Waypoint > waypointResults)
Long getMostRecent(List< Waypoint > points, List< Track > tracks)
static final Logger logger
Long findMostRecentTracks(List< Track > tracks)
static List< Waypoint > getAllWaypoints(SleuthkitCase skCase)
SleuthkitCase getSleuthkitCase()
abstract void handleFilteredWaypointSet(Set< MapWaypoint > mapWaypoints, List< Set< MapWaypoint >> tracks, List< Set< MapWaypoint >> areas, boolean wasEntirelySuccessful)
List< List< Waypoint > > getTracksInRange(Long timeRangeStart, Long timeRangeEnd, List< Track > tracks)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static GeoLocationParseResult< Area > getAreas(SleuthkitCase skCase, List<?extends Content > sourceList)
Long findMostRecentTimestamp(List< Waypoint > points)
boolean isSuccessfullyParsed()
List< Waypoint > getWaypointsInRange(Long timeRangeStart, Long timeRangeEnd, List< Waypoint > waypoints)
AbstractWaypointFetcher(GeoFilter filters)