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) {
202 BlackboardAttribute.ATTRIBUTE_TYPE type = BlackboardAttribute.ATTRIBUTE_TYPE.fromID(attribute.getAttributeType().getTypeID());
203 attributeMap.put(type, attribute);
204 }
catch(IllegalArgumentException ex) {
209 }
catch (TskCoreException ex) {
210 throw new GeoLocationDataException(
"Unable to get attributes from artifact", ex);
227 static List<Waypoint.Property> createGeolocationProperties(Map<BlackboardAttribute.ATTRIBUTE_TYPE, BlackboardAttribute> attributeMap)
throws GeoLocationDataException {
228 List<Waypoint.Property> list =
new ArrayList<>();
230 if(attributeMap != null) {
232 Set<BlackboardAttribute.ATTRIBUTE_TYPE> keys =
new HashSet<>(attributeMap.keySet());
234 for (BlackboardAttribute.ATTRIBUTE_TYPE type : ALREADY_HANDLED_ATTRIBUTES) {
238 for (BlackboardAttribute.ATTRIBUTE_TYPE type : keys) {
240 if (type.getValueType() == BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.JSON) {
243 String key = type.getDisplayName();
244 String value = attributeMap.get(type).getDisplayString();
246 list.add(
new Waypoint.Property(key, value));
268 Property(String displayName, String value) {
GeoPath getParentGeoPath()
List< Waypoint.Property > getOtherProperties()
final List< Waypoint.Property > propertiesList
final BlackboardArtifact artifact
BlackboardArtifact getArtifact()
final GeoPath parentGeoPath