19 package org.sleuthkit.autopsy.geolocation.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
25 import org.openide.util.NbBundle.Messages;
28 import org.
sleuthkit.datamodel.blackboardutils.attributes.BlackboardJsonAttrUtil;
29 import org.
sleuthkit.datamodel.blackboardutils.attributes.BlackboardJsonAttrUtil.InvalidJsonException;
30 import org.
sleuthkit.datamodel.blackboardutils.attributes.GeoTrackPoints;
65 startTimestamp = points.getStartTime();
66 endTimeStamp = points.getEndTime();
97 private static String
getTrackName(Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap) {
98 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME);
100 return attribute != null ? attribute.getValueString() :
"";
112 "# {0} - track name",
113 "GEOTrack_point_label_header=Trackpoint for track: {0}"
116 for (GeoTrackPoints.TrackPoint point : points) {
117 addToPath(
new TrackWaypoint(artifact, Bundle.GEOTrack_point_label_header(
getLabel()), point));
132 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_TRACKPOINTS);
133 if (attribute != null) {
135 return BlackboardJsonAttrUtil.fromAttribute(attribute, GeoTrackPoints.class);
136 }
catch (InvalidJsonException ex) {
146 final class TrackWaypoint
extends Waypoint {
161 TrackWaypoint(BlackboardArtifact artifact, String pointLabel, GeoTrackPoints.TrackPoint point) throws
GeoLocationDataException {
162 super(artifact, pointLabel,
163 point.getTimeStamp(),
165 point.getLongitude(),
171 propertyList = createPropertyList(point);
182 return Collections.unmodifiableList(propertyList);
193 "Track_distanceTraveled_displayName=Distance traveled",
194 "Track_distanceFromHome_displayName=Distance from home point"
196 private List<Waypoint.Property> createPropertyList(GeoTrackPoints.TrackPoint point) {
197 List<Waypoint.Property> list =
new ArrayList<>();
199 Long timestamp = point.getTimeStamp();
200 if (timestamp != null) {
201 list.add(
new Property(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getDisplayName(), timestamp.toString()));
204 Double value = point.getVelocity();
206 list.add(
new Property(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_VELOCITY.getDisplayName(), value.toString()));
209 value = point.getDistanceTraveled();
211 list.add(
new Property(Bundle.Track_distanceTraveled_displayName(), value.toString()));
214 value = point.getDistanceFromHomePoint();
216 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
GeoTrackPoints getPointsList(Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
static String getTrackName(Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
void buildPath(GeoTrackPoints points, BlackboardArtifact artifact)