How to save GPS coordinates in exif data on Android?

前端 未结 5 1412
借酒劲吻你
借酒劲吻你 2020-12-02 20:43

I am writing GPS coordinates to my JPEG image, and the coordinates are correct (as demonstrated by my logcat output) but it appears that it\'s being corrupted somehow. Readi

5条回答
  •  不思量自难忘°
    2020-12-02 21:21

    GPSLatitude

    Indicates the latitude. The latitude is expressed as three RATIONAL values giving the degrees, minutes, and seconds, respectively. If latitude is expressed as degrees, minutes and seconds, a typical format would be dd/1,mm/1,ss/1. When degrees and minutes are used and, for example, fractions of minutes are given up to two decimal places, the format would be dd/1,mmmm/100,0/1.

    https://docs.google.com/viewer?url=http%3A%2F%2Fwww.exif.org%2FExif2-2.PDF

    The Android docs specify this without explanation: http://developer.android.com/reference/android/media/ExifInterface.html#TAG_GPS_LATITUDE

    Exif data is standardized, and GPS data must be encoded using geographical coordinates (minutes, seconds, etc) described above instead of a fraction. Unless it's encoded in that format in the exif tag, it won't stick.

    How to encode: http://en.wikipedia.org/wiki/Geographic_coordinate_conversion

    How to decode: http://android-er.blogspot.com/2010/01/convert-exif-gps-info-to-degree-format.html

提交回复
热议问题