| 1 | /*
|
|---|
| 2 | * This is public domain software - that is, you can do whatever you want
|
|---|
| 3 | * with it, and include it software that is licensed under the GNU or the
|
|---|
| 4 | * BSD license, or whatever other licence you choose, including proprietary
|
|---|
| 5 | * closed source licenses. I do ask that you leave this header in tact.
|
|---|
| 6 | *
|
|---|
| 7 | * If you make modifications to this code that you think would benefit the
|
|---|
| 8 | * wider community, please send me a copy and I'll post it on my site.
|
|---|
| 9 | *
|
|---|
| 10 | * If you make use of this code, I'd appreciate hearing about it.
|
|---|
| 11 | * drew@drewnoakes.com
|
|---|
| 12 | * Latest version of this software kept at
|
|---|
| 13 | * http://drewnoakes.com/
|
|---|
| 14 | *
|
|---|
| 15 | * Created by dnoakes on 26-Nov-2002 11:00:52 using IntelliJ IDEA.
|
|---|
| 16 | */
|
|---|
| 17 | package com.drew.metadata.exif;
|
|---|
| 18 |
|
|---|
| 19 | import com.drew.metadata.Directory;
|
|---|
| 20 |
|
|---|
| 21 | import java.util.HashMap;
|
|---|
| 22 |
|
|---|
| 23 | /**
|
|---|
| 24 | *
|
|---|
| 25 | */
|
|---|
| 26 | public class GpsDirectory extends Directory
|
|---|
| 27 | {
|
|---|
| 28 | /** GPS tag version GPSVersionID 0 0 BYTE 4 */
|
|---|
| 29 | public static final int TAG_GPS_VERSION_ID = 0x0000;
|
|---|
| 30 | /** North or South Latitude GPSLatitudeRef 1 1 ASCII 2 */
|
|---|
| 31 | public static final int TAG_GPS_LATITUDE_REF = 0x0001;
|
|---|
| 32 | /** Latitude GPSLatitude 2 2 RATIONAL 3 */
|
|---|
| 33 | public static final int TAG_GPS_LATITUDE = 0x0002;
|
|---|
| 34 | /** East or West Longitude GPSLongitudeRef 3 3 ASCII 2 */
|
|---|
| 35 | public static final int TAG_GPS_LONGITUDE_REF = 0x0003;
|
|---|
| 36 | /** Longitude GPSLongitude 4 4 RATIONAL 3 */
|
|---|
| 37 | public static final int TAG_GPS_LONGITUDE = 0x0004;
|
|---|
| 38 | /** Altitude reference GPSAltitudeRef 5 5 BYTE 1 */
|
|---|
| 39 | public static final int TAG_GPS_ALTITUDE_REF = 0x0005;
|
|---|
| 40 | /** Altitude GPSAltitude 6 6 RATIONAL 1 */
|
|---|
| 41 | public static final int TAG_GPS_ALTITUDE = 0x0006;
|
|---|
| 42 | /** GPS time (atomic clock) GPSTimeStamp 7 7 RATIONAL 3 */
|
|---|
| 43 | public static final int TAG_GPS_TIME_STAMP = 0x0007;
|
|---|
| 44 | /** GPS satellites used for measurement GPSSatellites 8 8 ASCII Any */
|
|---|
| 45 | public static final int TAG_GPS_SATELLITES = 0x0008;
|
|---|
| 46 | /** GPS receiver status GPSStatus 9 9 ASCII 2 */
|
|---|
| 47 | public static final int TAG_GPS_STATUS = 0x0009;
|
|---|
| 48 | /** GPS measurement mode GPSMeasureMode 10 A ASCII 2 */
|
|---|
| 49 | public static final int TAG_GPS_MEASURE_MODE = 0x000A;
|
|---|
| 50 | /** Measurement precision GPSDOP 11 B RATIONAL 1 */
|
|---|
| 51 | public static final int TAG_GPS_DOP = 0x000B;
|
|---|
| 52 | /** Speed unit GPSSpeedRef 12 C ASCII 2 */
|
|---|
| 53 | public static final int TAG_GPS_SPEED_REF = 0x000C;
|
|---|
| 54 | /** Speed of GPS receiver GPSSpeed 13 D RATIONAL 1 */
|
|---|
| 55 | public static final int TAG_GPS_SPEED = 0x000D;
|
|---|
| 56 | /** Reference for direction of movement GPSTrackRef 14 E ASCII 2 */
|
|---|
| 57 | public static final int TAG_GPS_TRACK_REF = 0x000E;
|
|---|
| 58 | /** Direction of movement GPSTrack 15 F RATIONAL 1 */
|
|---|
| 59 | public static final int TAG_GPS_TRACK = 0x000F;
|
|---|
| 60 | /** Reference for direction of image GPSImgDirectionRef 16 10 ASCII 2 */
|
|---|
| 61 | public static final int TAG_GPS_IMG_DIRECTION_REF = 0x0010;
|
|---|
| 62 | /** Direction of image GPSImgDirection 17 11 RATIONAL 1 */
|
|---|
| 63 | public static final int TAG_GPS_IMG_DIRECTION = 0x0011;
|
|---|
| 64 | /** Geodetic survey data used GPSMapDatum 18 12 ASCII Any */
|
|---|
| 65 | public static final int TAG_GPS_MAP_DATUM = 0x0012;
|
|---|
| 66 | /** Reference for latitude of destination GPSDestLatitudeRef 19 13 ASCII 2 */
|
|---|
| 67 | public static final int TAG_GPS_DEST_LATITUDE_REF = 0x0013;
|
|---|
| 68 | /** Latitude of destination GPSDestLatitude 20 14 RATIONAL 3 */
|
|---|
| 69 | public static final int TAG_GPS_DEST_LATITUDE = 0x0014;
|
|---|
| 70 | /** Reference for longitude of destination GPSDestLongitudeRef 21 15 ASCII 2 */
|
|---|
| 71 | public static final int TAG_GPS_DEST_LONGITUDE_REF = 0x0015;
|
|---|
| 72 | /** Longitude of destination GPSDestLongitude 22 16 RATIONAL 3 */
|
|---|
| 73 | public static final int TAG_GPS_DEST_LONGITUDE = 0x0016;
|
|---|
| 74 | /** Reference for bearing of destination GPSDestBearingRef 23 17 ASCII 2 */
|
|---|
| 75 | public static final int TAG_GPS_DEST_BEARING_REF = 0x0017;
|
|---|
| 76 | /** Bearing of destination GPSDestBearing 24 18 RATIONAL 1 */
|
|---|
| 77 | public static final int TAG_GPS_DEST_BEARING = 0x0018;
|
|---|
| 78 | /** Reference for distance to destination GPSDestDistanceRef 25 19 ASCII 2 */
|
|---|
| 79 | public static final int TAG_GPS_DEST_DISTANCE_REF = 0x0019;
|
|---|
| 80 | /** Distance to destination GPSDestDistance 26 1A RATIONAL 1 */
|
|---|
| 81 | public static final int TAG_GPS_DEST_DISTANCE = 0x001A;
|
|---|
| 82 |
|
|---|
| 83 | protected static final HashMap tagNameMap = new HashMap();
|
|---|
| 84 |
|
|---|
| 85 | static
|
|---|
| 86 | {
|
|---|
| 87 | tagNameMap.put(new Integer(TAG_GPS_VERSION_ID), "GPS Version ID");
|
|---|
| 88 | tagNameMap.put(new Integer(TAG_GPS_LATITUDE_REF), "GPS Latitude Ref");
|
|---|
| 89 | tagNameMap.put(new Integer(TAG_GPS_LATITUDE), "GPS Latitude");
|
|---|
| 90 | tagNameMap.put(new Integer(TAG_GPS_LONGITUDE_REF), "GPS Longitude Ref");
|
|---|
| 91 | tagNameMap.put(new Integer(TAG_GPS_LONGITUDE), "GPS Longitude");
|
|---|
| 92 | tagNameMap.put(new Integer(TAG_GPS_ALTITUDE_REF), "GPS Altitude Ref");
|
|---|
| 93 | tagNameMap.put(new Integer(TAG_GPS_ALTITUDE), "GPS Altitude");
|
|---|
| 94 | tagNameMap.put(new Integer(TAG_GPS_TIME_STAMP), "GPS Time-Stamp");
|
|---|
| 95 | tagNameMap.put(new Integer(TAG_GPS_SATELLITES), "GPS Satellites");
|
|---|
| 96 | tagNameMap.put(new Integer(TAG_GPS_STATUS), "GPS Status");
|
|---|
| 97 | tagNameMap.put(new Integer(TAG_GPS_MEASURE_MODE), "GPS Measure Mode");
|
|---|
| 98 | tagNameMap.put(new Integer(TAG_GPS_DOP), "GPS DOP");
|
|---|
| 99 | tagNameMap.put(new Integer(TAG_GPS_SPEED_REF), "GPS Speed Ref");
|
|---|
| 100 | tagNameMap.put(new Integer(TAG_GPS_SPEED), "GPS Speed");
|
|---|
| 101 | tagNameMap.put(new Integer(TAG_GPS_TRACK_REF), "GPS Track Ref");
|
|---|
| 102 | tagNameMap.put(new Integer(TAG_GPS_TRACK), "GPS Track");
|
|---|
| 103 | tagNameMap.put(new Integer(TAG_GPS_IMG_DIRECTION_REF), "GPS Img Direction Ref");
|
|---|
| 104 | tagNameMap.put(new Integer(TAG_GPS_IMG_DIRECTION_REF), "GPS Img Direction");
|
|---|
| 105 | tagNameMap.put(new Integer(TAG_GPS_MAP_DATUM), "GPS Map Datum");
|
|---|
| 106 | tagNameMap.put(new Integer(TAG_GPS_DEST_LATITUDE_REF), "GPS Dest Latitude Ref");
|
|---|
| 107 | tagNameMap.put(new Integer(TAG_GPS_DEST_LATITUDE), "GPS Dest Latitude");
|
|---|
| 108 | tagNameMap.put(new Integer(TAG_GPS_DEST_LONGITUDE_REF), "GPS Dest Longitude Ref");
|
|---|
| 109 | tagNameMap.put(new Integer(TAG_GPS_DEST_LONGITUDE), "GPS Dest Longitude");
|
|---|
| 110 | tagNameMap.put(new Integer(TAG_GPS_DEST_BEARING_REF), "GPS Dest Bearing Ref");
|
|---|
| 111 | tagNameMap.put(new Integer(TAG_GPS_DEST_BEARING), "GPS Dest Bearing");
|
|---|
| 112 | tagNameMap.put(new Integer(TAG_GPS_DEST_DISTANCE_REF), "GPS Dest Distance Ref");
|
|---|
| 113 | tagNameMap.put(new Integer(TAG_GPS_DEST_DISTANCE), "GPS Dest Distance");
|
|---|
| 114 | }
|
|---|
| 115 |
|
|---|
| 116 | public GpsDirectory()
|
|---|
| 117 | {
|
|---|
| 118 | this.setDescriptor(new GpsDescriptor(this));
|
|---|
| 119 | }
|
|---|
| 120 |
|
|---|
| 121 | public String getName()
|
|---|
| 122 | {
|
|---|
| 123 | return "GPS";
|
|---|
| 124 | }
|
|---|
| 125 |
|
|---|
| 126 | protected HashMap getTagNameMap()
|
|---|
| 127 | {
|
|---|
| 128 | return tagNameMap;
|
|---|
| 129 | }
|
|---|
| 130 | }
|
|---|