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) {
138 return BlackboardJsonAttrUtil.fromAttribute(attribute, GeoTrackPoints.class);
139 }
catch (InvalidJsonException ex) {
147 final class TrackWaypoint
extends Waypoint {
162 TrackWaypoint(BlackboardArtifact artifact, String pointLabel, GeoTrackPoints.TrackPoint point) throws
GeoLocationDataException {
163 super(artifact, pointLabel,
164 point.getTimeStamp(),
166 point.getLongitude(),
172 propertyList = createPropertyList(point);
183 return Collections.unmodifiableList(propertyList);
194 "Track_distanceTraveled_displayName=Distance traveled",
195 "Track_distanceFromHome_displayName=Distance from home point"
197 private List<Waypoint.Property> createPropertyList(GeoTrackPoints.TrackPoint point) {
198 List<Waypoint.Property> list =
new ArrayList<>();
200 Double value = point.getVelocity();
202 list.add(
new Property(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_VELOCITY.getDisplayName(), value.toString()));
205 value = point.getDistanceTraveled();
207 list.add(
new Property(Bundle.Track_distanceTraveled_displayName(), value.toString()));
210 value = point.getDistanceFromHomePoint();
212 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)