Go to the documentation of this file.
20package org.sleuthkit.autopsy.geolocation.datamodel;
22import java.util.Collections;
23import java.util.HashMap;
26import org.openide.util.NbBundle.Messages;
27import org.sleuthkit.datamodel.BlackboardArtifact;
28import org.sleuthkit.datamodel.BlackboardAttribute;
29import org.sleuthkit.datamodel.blackboardutils.attributes.BlackboardJsonAttrUtil;
30import org.sleuthkit.datamodel.blackboardutils.attributes.BlackboardJsonAttrUtil.InvalidJsonException;
31import org.sleuthkit.datamodel.blackboardutils.attributes.GeoWaypoints;
39public class Route
extends GeoPath {
55 "Route_Label=As-the-crow-flies Route"
58 super(
artifact, Bundle.Route_Label());
60 Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap =
Waypoint.getAttributesFromArtifactAsMap(
artifact);
62 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME);
63 timestamp = attribute !=
null ? attribute.getValueLong() :
null;
108 "Route_point_label=Waypoints for route"
111 BlackboardAttribute attribute = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_WAYPOINTS);
114 if (label ==
null || label.isEmpty()) {
115 label = Bundle.Route_point_label();
117 label = String.format(
"%s: %s", Bundle.Route_point_label(), label);
120 if (attribute !=
null) {
121 GeoWaypoints waypoints;
123 waypoints = BlackboardJsonAttrUtil.fromAttribute(attribute, GeoWaypoints.class);
124 }
catch (InvalidJsonException ex) {
125 throw new GeoLocationDataException(String.format(
"Unable to parse waypoints in TSK_GEO_WAYPOINTS attribute (artifact object ID =%d)",
artifact.getId()), ex);
127 for (GeoWaypoints.Waypoint waypoint : waypoints) {
128 String name = waypoint.getName();
129 Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> map = attributeMap;
130 if(name !=
null && !name.isEmpty()) {
131 BlackboardAttribute pointNameAtt =
new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_LOCATION,
"", name);
132 map =
new HashMap<>(attributeMap);
133 map.put(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_LOCATION, pointNameAtt);
135 addToPath(
new Waypoint(
artifact, label,
timestamp, waypoint.getLatitude(), waypoint.getLongitude(), waypoint.getAltitude(),
null, map,
this));
159 "Route_Start_Label=Start"
163 BlackboardAttribute latitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_START);
164 BlackboardAttribute longitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_START);
165 BlackboardAttribute altitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE);
167 if (latitude !=
null && longitude !=
null) {
169 Bundle.Route_Start_Label(),
171 latitude.getValueDouble(),
172 longitude.getValueDouble(),
173 altitude !=
null ? altitude.getValueDouble() :
null,
194 "Route_End_Label=End"
197 BlackboardAttribute latitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_END);
198 BlackboardAttribute longitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_END);
199 BlackboardAttribute altitude = attributeMap.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE);
201 if (latitude !=
null && longitude !=
null) {
204 Bundle.Route_End_Label(),
206 latitude.getValueDouble(),
207 longitude.getValueDouble(),
208 altitude !=
null ? altitude.getValueDouble() :
null,
final List< Waypoint > getPath()
final BlackboardArtifact artifact
Waypoint getRouteStartPoint(BlackboardArtifact artifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
Waypoint getRouteEndPoint(BlackboardArtifact artifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
final List< Waypoint.Property > propertiesList
void createRoute(BlackboardArtifact artifact, Map< BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute > attributeMap)
List< Waypoint > getRoute()
List< Waypoint.Property > getOtherProperties()
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.