20 package org.sleuthkit.autopsy.geolocation.datamodel;
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.GeoWaypoints;
54 "Route_Label=As-the-crow-flies Route"
57 super(
artifact, Bundle.Route_Label());
59 Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap =
Waypoint.getAttributesFromArtifactAsMap(
artifact);
63 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME);
64 timestamp = attribute != null ? attribute.getValueLong() : null;
107 "Route_point_label=Waypoints for route"
110 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_WAYPOINTS);
113 if (label == null || label.isEmpty()) {
114 label = Bundle.Route_point_label();
116 label = String.format(
"%s: %s", Bundle.Route_point_label(), label);
119 if (attribute != null) {
120 GeoWaypoints waypoints;
122 waypoints = BlackboardJsonAttrUtil.fromAttribute(attribute, GeoWaypoints.class);
123 }
catch (InvalidJsonException ex) {
124 throw new GeoLocationDataException(String.format(
"Unable to parse waypoints in TSK_GEO_WAYPOINTS attribute (artifact object ID =%d)", artifact.getId()), ex);
126 for (GeoWaypoints.Waypoint waypoint : waypoints) {
127 addToPath(
new Waypoint(artifact, label, null, waypoint.getLatitude(), waypoint.getLongitude(), waypoint.getAltitude(), null, attributeMap,
this));
151 "Route_Start_Label=Start"
155 BlackboardAttribute latitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_START);
156 BlackboardAttribute longitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_START);
157 BlackboardAttribute altitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE);
159 if (latitude != null && longitude != null) {
161 Bundle.Route_Start_Label(),
162 latitude.getValueDouble(),
163 longitude.getValueDouble(),
164 altitude != null ? altitude.getValueDouble() : null,
184 "Route_End_Label=End"
187 BlackboardAttribute latitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_END);
188 BlackboardAttribute longitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_END);
189 BlackboardAttribute altitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE);
191 if (latitude != null && longitude != null) {
194 Bundle.Route_End_Label(),
195 latitude.getValueDouble(),
196 longitude.getValueDouble(),
197 altitude != null ? altitude.getValueDouble() : null,
GeoPath getParentGeoPath()
List< Waypoint > getRoute()
Waypoint getRouteEndPoint(BlackboardArtifact artifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
final List< Waypoint.Property > propertiesList
final BlackboardArtifact artifact
final List< Waypoint > getPath()
List< Waypoint.Property > getOtherProperties()
void createRoute(BlackboardArtifact artifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
Waypoint getRouteStartPoint(BlackboardArtifact artifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)