Changeset 8132 in josm for trunk/src/com/drew/metadata/exif/GpsDirectory.java
- Timestamp:
- 2015-03-10T01:17:39+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/com/drew/metadata/exif/GpsDirectory.java
r6127 r8132 1 1 /* 2 * Copyright 2002-201 2Drew Noakes2 * Copyright 2002-2015 Drew Noakes 3 3 * 4 4 * Licensed under the Apache License, Version 2.0 (the "License"); … … 16 16 * More information about this project is available at: 17 17 * 18 * http://drewnoakes.com/code/exif/ 19 * http ://code.google.com/p/metadata-extractor/18 * https://drewnoakes.com/code/exif/ 19 * https://github.com/drewnoakes/metadata-extractor 20 20 */ 21 21 package com.drew.metadata.exif; … … 32 32 * Describes Exif tags that contain Global Positioning System (GPS) data. 33 33 * 34 * @author Drew Noakes http://drewnoakes.com 34 * @author Drew Noakes https://drewnoakes.com 35 35 */ 36 36 public class GpsDirectory extends Directory 37 37 { 38 38 /** GPS tag version GPSVersionID 0 0 BYTE 4 */ 39 public static final int TAG_ GPS_VERSION_ID = 0x0000;39 public static final int TAG_VERSION_ID = 0x0000; 40 40 /** North or South Latitude GPSLatitudeRef 1 1 ASCII 2 */ 41 public static final int TAG_ GPS_LATITUDE_REF = 0x0001;41 public static final int TAG_LATITUDE_REF = 0x0001; 42 42 /** Latitude GPSLatitude 2 2 RATIONAL 3 */ 43 public static final int TAG_ GPS_LATITUDE = 0x0002;43 public static final int TAG_LATITUDE = 0x0002; 44 44 /** East or West Longitude GPSLongitudeRef 3 3 ASCII 2 */ 45 public static final int TAG_ GPS_LONGITUDE_REF = 0x0003;45 public static final int TAG_LONGITUDE_REF = 0x0003; 46 46 /** Longitude GPSLongitude 4 4 RATIONAL 3 */ 47 public static final int TAG_ GPS_LONGITUDE = 0x0004;47 public static final int TAG_LONGITUDE = 0x0004; 48 48 /** Altitude reference GPSAltitudeRef 5 5 BYTE 1 */ 49 public static final int TAG_ GPS_ALTITUDE_REF = 0x0005;49 public static final int TAG_ALTITUDE_REF = 0x0005; 50 50 /** Altitude GPSAltitude 6 6 RATIONAL 1 */ 51 public static final int TAG_ GPS_ALTITUDE = 0x0006;51 public static final int TAG_ALTITUDE = 0x0006; 52 52 /** GPS time (atomic clock) GPSTimeStamp 7 7 RATIONAL 3 */ 53 public static final int TAG_ GPS_TIME_STAMP = 0x0007;53 public static final int TAG_TIME_STAMP = 0x0007; 54 54 /** GPS satellites used for measurement GPSSatellites 8 8 ASCII Any */ 55 public static final int TAG_ GPS_SATELLITES = 0x0008;55 public static final int TAG_SATELLITES = 0x0008; 56 56 /** GPS receiver status GPSStatus 9 9 ASCII 2 */ 57 public static final int TAG_ GPS_STATUS = 0x0009;57 public static final int TAG_STATUS = 0x0009; 58 58 /** GPS measurement mode GPSMeasureMode 10 A ASCII 2 */ 59 public static final int TAG_ GPS_MEASURE_MODE = 0x000A;59 public static final int TAG_MEASURE_MODE = 0x000A; 60 60 /** Measurement precision GPSDOP 11 B RATIONAL 1 */ 61 public static final int TAG_ GPS_DOP = 0x000B;61 public static final int TAG_DOP = 0x000B; 62 62 /** Speed unit GPSSpeedRef 12 C ASCII 2 */ 63 public static final int TAG_ GPS_SPEED_REF = 0x000C;63 public static final int TAG_SPEED_REF = 0x000C; 64 64 /** Speed of GPS receiver GPSSpeed 13 D RATIONAL 1 */ 65 public static final int TAG_ GPS_SPEED = 0x000D;65 public static final int TAG_SPEED = 0x000D; 66 66 /** Reference for direction of movement GPSTrackRef 14 E ASCII 2 */ 67 public static final int TAG_ GPS_TRACK_REF = 0x000E;67 public static final int TAG_TRACK_REF = 0x000E; 68 68 /** Direction of movement GPSTrack 15 F RATIONAL 1 */ 69 public static final int TAG_ GPS_TRACK = 0x000F;69 public static final int TAG_TRACK = 0x000F; 70 70 /** Reference for direction of image GPSImgDirectionRef 16 10 ASCII 2 */ 71 public static final int TAG_ GPS_IMG_DIRECTION_REF = 0x0010;71 public static final int TAG_IMG_DIRECTION_REF = 0x0010; 72 72 /** Direction of image GPSImgDirection 17 11 RATIONAL 1 */ 73 public static final int TAG_ GPS_IMG_DIRECTION = 0x0011;73 public static final int TAG_IMG_DIRECTION = 0x0011; 74 74 /** Geodetic survey data used GPSMapDatum 18 12 ASCII Any */ 75 public static final int TAG_ GPS_MAP_DATUM = 0x0012;75 public static final int TAG_MAP_DATUM = 0x0012; 76 76 /** Reference for latitude of destination GPSDestLatitudeRef 19 13 ASCII 2 */ 77 public static final int TAG_ GPS_DEST_LATITUDE_REF = 0x0013;77 public static final int TAG_DEST_LATITUDE_REF = 0x0013; 78 78 /** Latitude of destination GPSDestLatitude 20 14 RATIONAL 3 */ 79 public static final int TAG_ GPS_DEST_LATITUDE = 0x0014;79 public static final int TAG_DEST_LATITUDE = 0x0014; 80 80 /** Reference for longitude of destination GPSDestLongitudeRef 21 15 ASCII 2 */ 81 public static final int TAG_ GPS_DEST_LONGITUDE_REF = 0x0015;81 public static final int TAG_DEST_LONGITUDE_REF = 0x0015; 82 82 /** Longitude of destination GPSDestLongitude 22 16 RATIONAL 3 */ 83 public static final int TAG_ GPS_DEST_LONGITUDE = 0x0016;83 public static final int TAG_DEST_LONGITUDE = 0x0016; 84 84 /** Reference for bearing of destination GPSDestBearingRef 23 17 ASCII 2 */ 85 public static final int TAG_ GPS_DEST_BEARING_REF = 0x0017;85 public static final int TAG_DEST_BEARING_REF = 0x0017; 86 86 /** Bearing of destination GPSDestBearing 24 18 RATIONAL 1 */ 87 public static final int TAG_ GPS_DEST_BEARING = 0x0018;87 public static final int TAG_DEST_BEARING = 0x0018; 88 88 /** Reference for distance to destination GPSDestDistanceRef 25 19 ASCII 2 */ 89 public static final int TAG_ GPS_DEST_DISTANCE_REF = 0x0019;89 public static final int TAG_DEST_DISTANCE_REF = 0x0019; 90 90 /** Distance to destination GPSDestDistance 26 1A RATIONAL 1 */ 91 public static final int TAG_ GPS_DEST_DISTANCE = 0x001A;91 public static final int TAG_DEST_DISTANCE = 0x001A; 92 92 93 93 /** Values of "GPS", "CELLID", "WLAN" or "MANUAL" by the EXIF spec. */ 94 public static final int TAG_ GPS_PROCESSING_METHOD = 0x001B;95 public static final int TAG_ GPS_AREA_INFORMATION = 0x001C;96 public static final int TAG_ GPS_DATE_STAMP = 0x001D;97 public static final int TAG_ GPS_DIFFERENTIAL = 0x001E;94 public static final int TAG_PROCESSING_METHOD = 0x001B; 95 public static final int TAG_AREA_INFORMATION = 0x001C; 96 public static final int TAG_DATE_STAMP = 0x001D; 97 public static final int TAG_DIFFERENTIAL = 0x001E; 98 98 99 99 @NotNull … … 102 102 static 103 103 { 104 _tagNameMap.put(TAG_ GPS_VERSION_ID, "GPS Version ID");105 _tagNameMap.put(TAG_ GPS_LATITUDE_REF, "GPS Latitude Ref");106 _tagNameMap.put(TAG_ GPS_LATITUDE, "GPS Latitude");107 _tagNameMap.put(TAG_ GPS_LONGITUDE_REF, "GPS Longitude Ref");108 _tagNameMap.put(TAG_ GPS_LONGITUDE, "GPS Longitude");109 _tagNameMap.put(TAG_ GPS_ALTITUDE_REF, "GPS Altitude Ref");110 _tagNameMap.put(TAG_ GPS_ALTITUDE, "GPS Altitude");111 _tagNameMap.put(TAG_ GPS_TIME_STAMP, "GPS Time-Stamp");112 _tagNameMap.put(TAG_ GPS_SATELLITES, "GPS Satellites");113 _tagNameMap.put(TAG_ GPS_STATUS, "GPS Status");114 _tagNameMap.put(TAG_ GPS_MEASURE_MODE, "GPS Measure Mode");115 _tagNameMap.put(TAG_ GPS_DOP, "GPS DOP");116 _tagNameMap.put(TAG_ GPS_SPEED_REF, "GPS Speed Ref");117 _tagNameMap.put(TAG_ GPS_SPEED, "GPS Speed");118 _tagNameMap.put(TAG_ GPS_TRACK_REF, "GPS Track Ref");119 _tagNameMap.put(TAG_ GPS_TRACK, "GPS Track");120 _tagNameMap.put(TAG_ GPS_IMG_DIRECTION_REF, "GPS Img Direction Ref");121 _tagNameMap.put(TAG_ GPS_IMG_DIRECTION, "GPS Img Direction");122 _tagNameMap.put(TAG_ GPS_MAP_DATUM, "GPS Map Datum");123 _tagNameMap.put(TAG_ GPS_DEST_LATITUDE_REF, "GPS Dest Latitude Ref");124 _tagNameMap.put(TAG_ GPS_DEST_LATITUDE, "GPS Dest Latitude");125 _tagNameMap.put(TAG_ GPS_DEST_LONGITUDE_REF, "GPS Dest Longitude Ref");126 _tagNameMap.put(TAG_ GPS_DEST_LONGITUDE, "GPS Dest Longitude");127 _tagNameMap.put(TAG_ GPS_DEST_BEARING_REF, "GPS Dest Bearing Ref");128 _tagNameMap.put(TAG_ GPS_DEST_BEARING, "GPS Dest Bearing");129 _tagNameMap.put(TAG_ GPS_DEST_DISTANCE_REF, "GPS Dest Distance Ref");130 _tagNameMap.put(TAG_ GPS_DEST_DISTANCE, "GPS Dest Distance");131 _tagNameMap.put(TAG_ GPS_PROCESSING_METHOD, "GPS Processing Method");132 _tagNameMap.put(TAG_ GPS_AREA_INFORMATION, "GPS Area Information");133 _tagNameMap.put(TAG_ GPS_DATE_STAMP, "GPS Date Stamp");134 _tagNameMap.put(TAG_ GPS_DIFFERENTIAL, "GPS Differential");104 _tagNameMap.put(TAG_VERSION_ID, "GPS Version ID"); 105 _tagNameMap.put(TAG_LATITUDE_REF, "GPS Latitude Ref"); 106 _tagNameMap.put(TAG_LATITUDE, "GPS Latitude"); 107 _tagNameMap.put(TAG_LONGITUDE_REF, "GPS Longitude Ref"); 108 _tagNameMap.put(TAG_LONGITUDE, "GPS Longitude"); 109 _tagNameMap.put(TAG_ALTITUDE_REF, "GPS Altitude Ref"); 110 _tagNameMap.put(TAG_ALTITUDE, "GPS Altitude"); 111 _tagNameMap.put(TAG_TIME_STAMP, "GPS Time-Stamp"); 112 _tagNameMap.put(TAG_SATELLITES, "GPS Satellites"); 113 _tagNameMap.put(TAG_STATUS, "GPS Status"); 114 _tagNameMap.put(TAG_MEASURE_MODE, "GPS Measure Mode"); 115 _tagNameMap.put(TAG_DOP, "GPS DOP"); 116 _tagNameMap.put(TAG_SPEED_REF, "GPS Speed Ref"); 117 _tagNameMap.put(TAG_SPEED, "GPS Speed"); 118 _tagNameMap.put(TAG_TRACK_REF, "GPS Track Ref"); 119 _tagNameMap.put(TAG_TRACK, "GPS Track"); 120 _tagNameMap.put(TAG_IMG_DIRECTION_REF, "GPS Img Direction Ref"); 121 _tagNameMap.put(TAG_IMG_DIRECTION, "GPS Img Direction"); 122 _tagNameMap.put(TAG_MAP_DATUM, "GPS Map Datum"); 123 _tagNameMap.put(TAG_DEST_LATITUDE_REF, "GPS Dest Latitude Ref"); 124 _tagNameMap.put(TAG_DEST_LATITUDE, "GPS Dest Latitude"); 125 _tagNameMap.put(TAG_DEST_LONGITUDE_REF, "GPS Dest Longitude Ref"); 126 _tagNameMap.put(TAG_DEST_LONGITUDE, "GPS Dest Longitude"); 127 _tagNameMap.put(TAG_DEST_BEARING_REF, "GPS Dest Bearing Ref"); 128 _tagNameMap.put(TAG_DEST_BEARING, "GPS Dest Bearing"); 129 _tagNameMap.put(TAG_DEST_DISTANCE_REF, "GPS Dest Distance Ref"); 130 _tagNameMap.put(TAG_DEST_DISTANCE, "GPS Dest Distance"); 131 _tagNameMap.put(TAG_PROCESSING_METHOD, "GPS Processing Method"); 132 _tagNameMap.put(TAG_AREA_INFORMATION, "GPS Area Information"); 133 _tagNameMap.put(TAG_DATE_STAMP, "GPS Date Stamp"); 134 _tagNameMap.put(TAG_DIFFERENTIAL, "GPS Differential"); 135 135 } 136 136 … … 140 140 } 141 141 142 @Override 142 143 @NotNull 143 144 public String getName() … … 146 147 } 147 148 149 @Override 148 150 @NotNull 149 151 protected HashMap<Integer, String> getTagNameMap() … … 161 163 public GeoLocation getGeoLocation() 162 164 { 163 Rational[] latitudes = getRationalArray(GpsDirectory.TAG_ GPS_LATITUDE);164 Rational[] longitudes = getRationalArray(GpsDirectory.TAG_ GPS_LONGITUDE);165 String latitudeRef = getString(GpsDirectory.TAG_ GPS_LATITUDE_REF);166 String longitudeRef = getString(GpsDirectory.TAG_ GPS_LONGITUDE_REF);165 Rational[] latitudes = getRationalArray(GpsDirectory.TAG_LATITUDE); 166 Rational[] longitudes = getRationalArray(GpsDirectory.TAG_LONGITUDE); 167 String latitudeRef = getString(GpsDirectory.TAG_LATITUDE_REF); 168 String longitudeRef = getString(GpsDirectory.TAG_LONGITUDE_REF); 167 169 168 170 // Make sure we have the required values
Note:
See TracChangeset
for help on using the changeset viewer.
