From 073dc830aa4b5c33dbf6d32364234669f3258449 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Wed, 8 Jul 2020 14:43:55 -0400 Subject: [PATCH 1/2] Geolocation:Added missing details to panel --- .../autopsy/geolocation/datamodel/Route.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/Route.java b/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/Route.java index 13a23b30e3..3dac2d32df 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/Route.java +++ b/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/Route.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.geolocation.datamodel; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import org.openide.util.NbBundle.Messages; @@ -124,7 +125,14 @@ public class Route extends GeoPath { throw new GeoLocationDataException(String.format("Unable to parse waypoints in TSK_GEO_WAYPOINTS attribute (artifact object ID =%d)", artifact.getId()), ex); } for (GeoWaypoints.Waypoint waypoint : waypoints) { - addToPath(new Waypoint(artifact, label, null, waypoint.getLatitude(), waypoint.getLongitude(), waypoint.getAltitude(), null, attributeMap, this)); + String name = waypoint.getName(); + Map map = attributeMap; + if(name != null && !name.isEmpty()) { + BlackboardAttribute pointNameAtt = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_LOCATION, "", name); + map = new HashMap<>(attributeMap); + map.put(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_LOCATION, pointNameAtt); + } + addToPath(new Waypoint(artifact, label, null, waypoint.getLatitude(), waypoint.getLongitude(), waypoint.getAltitude(), null, map, this)); } } else { Waypoint start = getRouteStartPoint(artifact, attributeMap); @@ -157,12 +165,14 @@ public class Route extends GeoPath { BlackboardAttribute altitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE); if (latitude != null && longitude != null) { - return new RoutePoint(artifact, + return new Waypoint(artifact, Bundle.Route_Start_Label(), + null, latitude.getValueDouble(), longitude.getValueDouble(), altitude != null ? altitude.getValueDouble() : null, - attributeMap); + null, + attributeMap, this); } else { throw new GeoLocationDataException("Unable to create route start point, invalid longitude and/or latitude"); } @@ -190,12 +200,15 @@ public class Route extends GeoPath { if (latitude != null && longitude != null) { - return new RoutePoint(artifact, + return new Waypoint(artifact, Bundle.Route_End_Label(), + null, latitude.getValueDouble(), longitude.getValueDouble(), altitude != null ? altitude.getValueDouble() : null, - attributeMap); + null, + attributeMap, + this); } else { throw new GeoLocationDataException("Unable to create route end point, invalid longitude and/or latitude"); } From 5c5a8cba213f4e508001870a2ff1c4eadd8a4fdc Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Wed, 8 Jul 2020 16:44:47 -0400 Subject: [PATCH 2/2] Added route creation timestamp to all route points --- .../autopsy/geolocation/datamodel/Route.java | 45 +++---------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/Route.java b/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/Route.java index 3dac2d32df..d275c20ac1 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/Route.java +++ b/Core/src/org/sleuthkit/autopsy/geolocation/datamodel/Route.java @@ -59,12 +59,12 @@ public class Route extends GeoPath { Map attributeMap = Waypoint.getAttributesFromArtifactAsMap(artifact); - createRoute(artifact, attributeMap); - BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME); timestamp = attribute != null ? attribute.getValueLong() : null; propertiesList = Waypoint.createGeolocationProperties(attributeMap); + + createRoute(artifact, attributeMap); } /** @@ -132,7 +132,7 @@ public class Route extends GeoPath { map = new HashMap<>(attributeMap); map.put(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_LOCATION, pointNameAtt); } - addToPath(new Waypoint(artifact, label, null, waypoint.getLatitude(), waypoint.getLongitude(), waypoint.getAltitude(), null, map, this)); + addToPath(new Waypoint(artifact, label, timestamp, waypoint.getLatitude(), waypoint.getLongitude(), waypoint.getAltitude(), null, map, this)); } } else { Waypoint start = getRouteStartPoint(artifact, attributeMap); @@ -167,7 +167,7 @@ public class Route extends GeoPath { if (latitude != null && longitude != null) { return new Waypoint(artifact, Bundle.Route_Start_Label(), - null, + timestamp, latitude.getValueDouble(), longitude.getValueDouble(), altitude != null ? altitude.getValueDouble() : null, @@ -202,7 +202,7 @@ public class Route extends GeoPath { return new Waypoint(artifact, Bundle.Route_End_Label(), - null, + timestamp, latitude.getValueDouble(), longitude.getValueDouble(), altitude != null ? altitude.getValueDouble() : null, @@ -213,39 +213,4 @@ public class Route extends GeoPath { throw new GeoLocationDataException("Unable to create route end point, invalid longitude and/or latitude"); } } - - /** - * Route waypoint specific implementation of Waypoint. - */ - private class RoutePoint extends Waypoint { - - /** - * Construct a RoutePoint - * - * @param artifact BlackboardArtifact for this waypoint - * @param label String waypoint label - * @param latitude Double waypoint latitude - * @param longitude Double waypoint longitude - * - * @param attributeMap A Map of attributes for the given artifact - * - * @throws GeoLocationDataException - */ - RoutePoint(BlackboardArtifact artifact, String label, Double latitude, Double longitude, Double altitude, Map attributeMap) throws GeoLocationDataException { - super(artifact, - label, - null, - latitude, - longitude, - altitude, - null, - attributeMap, - Route.this); - } - - @Override - public Long getTimestamp() { - return ((Route) getParentGeoPath()).getTimestamp(); - } - } }