19 package org.sleuthkit.autopsy.geolocation.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.HashMap;
24 import java.util.HashSet;
25 import java.util.List;
44 final private AbstractFile
image;
54 static final BlackboardAttribute.ATTRIBUTE_TYPE[] ALREADY_HANDLED_ATTRIBUTES = {
55 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME,
56 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE,
57 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE,
58 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE,
59 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME,
60 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
61 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_START,
62 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_START,
63 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_END,
64 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_END,};
81 Waypoint(BlackboardArtifact artifact, String label, Long timestamp, Double latitude, Double longitude, Double altitude, AbstractFile image, Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap,
GeoPath parentGeoPath)
throws GeoLocationDataException {
82 if (longitude == null || latitude == null) {
196 static Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> getAttributesFromArtifactAsMap(BlackboardArtifact artifact)
throws GeoLocationDataException {
197 Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap =
new HashMap<>();
199 List<BlackboardAttribute> attributeList = artifact.getAttributes();
200 for (BlackboardAttribute attribute : attributeList) {
201 BlackboardAttribute.ATTRIBUTE_TYPE type = BlackboardAttribute.ATTRIBUTE_TYPE.fromID(attribute.getAttributeType().getTypeID());
202 attributeMap.put(type, attribute);
204 }
catch (TskCoreException ex) {
205 throw new GeoLocationDataException(
"Unable to get attributes from artifact", ex);
222 static List<Waypoint.Property> createGeolocationProperties(Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap)
throws GeoLocationDataException {
223 List<Waypoint.Property> list =
new ArrayList<>();
225 if(attributeMap != null) {
227 Set<BlackboardAttribute.ATTRIBUTE_TYPE> keys =
new HashSet<>(attributeMap.keySet());
229 for (BlackboardAttribute.ATTRIBUTE_TYPE type : ALREADY_HANDLED_ATTRIBUTES) {
233 for (BlackboardAttribute.ATTRIBUTE_TYPE type : keys) {
235 if (type.getValueType() == BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.JSON) {
238 String key = type.getDisplayName();
239 String value = attributeMap.get(type).getDisplayString();
241 list.add(
new Waypoint.Property(key, value));
263 Property(String displayName, String value) {
GeoPath getParentGeoPath()
List< Waypoint.Property > getOtherProperties()
final List< Waypoint.Property > propertiesList
final BlackboardArtifact artifact
BlackboardArtifact getArtifact()
final GeoPath parentGeoPath