19 package org.sleuthkit.autopsy.geolocation.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
25 import java.util.logging.Level;
26 import org.openide.util.NbBundle.Messages;
29 import org.
sleuthkit.datamodel.blackboardutils.attributes.BlackboardJsonAttrUtil;
30 import org.
sleuthkit.datamodel.blackboardutils.attributes.BlackboardJsonAttrUtil.InvalidJsonException;
31 import org.
sleuthkit.datamodel.blackboardutils.attributes.GeoTrackPoints;
68 startTimestamp = points.getStartTime();
69 endTimeStamp = points.getEndTime();
100 private static String
getTrackName(Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap) {
101 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME);
103 return attribute != null ? attribute.getValueString() :
"";
115 "# {0} - track name",
116 "GEOTrack_point_label_header=Trackpoint for track: {0}"
119 for (GeoTrackPoints.TrackPoint point : points) {
120 addToPath(
new TrackWaypoint(artifact, Bundle.GEOTrack_point_label_header(
getLabel()), point));
135 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_TRACKPOINTS);
136 if (attribute == null) {
137 LOGGER.log(Level.SEVERE,
"No TSK_GEO_TRACKPOINTS attribute was present on the artifact.");
142 return BlackboardJsonAttrUtil.fromAttribute(attribute, GeoTrackPoints.class);
143 }
catch (InvalidJsonException ex) {
144 LOGGER.log(Level.SEVERE,
"TSK_GEO_TRACKPOINTS could not be properly parsed from TSK_GEO_TRACKPOINTS attribute.");
152 final class TrackWaypoint
extends Waypoint {
167 TrackWaypoint(BlackboardArtifact artifact, String pointLabel, GeoTrackPoints.TrackPoint point) throws
GeoLocationDataException {
168 super(artifact, pointLabel,
169 point.getTimeStamp(),
171 point.getLongitude(),
177 propertyList = createPropertyList(point);
188 return Collections.unmodifiableList(propertyList);
199 "Track_distanceTraveled_displayName=Distance traveled",
200 "Track_distanceFromHome_displayName=Distance from home point"
202 private List<Waypoint.Property> createPropertyList(GeoTrackPoints.TrackPoint point) {
203 List<Waypoint.Property> list =
new ArrayList<>();
205 Long timestamp = point.getTimeStamp();
206 if (timestamp != null) {
207 list.add(
new Property(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getDisplayName(), timestamp.toString()));
210 Double value = point.getVelocity();
212 list.add(
new Property(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_VELOCITY.getDisplayName(), value.toString()));
215 value = point.getDistanceTraveled();
217 list.add(
new Property(Bundle.Track_distanceTraveled_displayName(), value.toString()));
220 value = point.getDistanceFromHomePoint();
222 list.add(
new Property(Bundle.Track_distanceFromHome_displayName(), value.toString()));
Track(BlackboardArtifact artifact)
Track(BlackboardArtifact artifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
final BlackboardArtifact artifact
final Long startTimestamp
static final Logger LOGGER
GeoTrackPoints getPointsList(Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
static String getTrackName(Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
synchronized static Logger getLogger(String name)
void buildPath(GeoTrackPoints points, BlackboardArtifact artifact)