日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

不丢失精度的获取照片的Gps经纬度

發布時間:2023/11/27 生活经验 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 不丢失精度的获取照片的Gps经纬度 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

不丟失精度的獲取照片的Gps經緯度

    • 1. 實際照片存儲經緯度
    • 2. **用pyhton exifread讀取**
    • 3. 用java metadata-extractor讀取
    • 4. windows用 exiftool命令行讀取
    • 參考

查了超多的資料,發現照片的GPS信息是以rational64u 有理數的格式存儲的。如經度、緯度度,在Exif中是以3個浮點數,度,分,秒來存儲的。

而讀取出來后,也將是用有理數表示, 如 40可以表示為 40,1

1. 實際照片存儲經緯度

2. 用pyhton exifread讀取

ExifRead          2.3.2

GPS GPSLatitudeRef N
GPS GPSLatitude [40, 0, 638031/20000]
lat except: [40, 0, 638031/20000] 40.00886154166667

GPS GPSLongitudeRef E
GPS GPSLongitude [116, 23, 11610717/1000000]
lon except: [116, 23, 11610717/1000000] 116.3865585325

3. 用java metadata-extractor讀取

<!--獲取相機exif信息-->
<dependency><groupId>com.drewnoakes</groupId><artifactId>metadata-extractor</artifactId><version>2.16.0</version>
</dependency>

經度 GPS Latitude : 40° 4’ 22.74", °轉dec: 40.07298333333333
緯度 GPS Longitude : 116° 20’ 37.01", °轉dec: 116.34361388888888

4. windows用 exiftool命令行讀取

exiftoo下載:https://exiftool.org/

D:\pyproject>“exiftool(-k).exe” -v E:/BaiduNetdiskDownload/images/IMG_20201220_171156.jpg

| 13) GPSInfo (SubDirectory) -->
| + [GPS directory with 10 entries]
| | 0) GPSVersionID = 2 2 0 0
| | 1) GPSLatitudeRef = N
| | 2) GPSLatitude = 40 0 31.90155 (40/1 0/1 31901550/1000000)
| | 3) GPSLongitudeRef = E
| | 4) GPSLongitude = 116 23 11.610717 (116/1 23/1 11610717/1000000)
| | 5) GPSAltitudeRef = 1
| | 6) GPSAltitude = 0 (0/100)
| | 7) GPSTimeStamp = 9 11 56 (9/1 11/1 56/1)
| | 8) GPSProcessingMethod = CELLID
| | 9) GPSDateStamp = 2020:12:20

參考

  • https://exiftool.org/TagNames/EXIF.html
  • https://exiftool.org/TagNames/GPS.html
  • https://stackoverflow.com/questions/1976500/how-to-get-raw-jpeg-data-but-no-metatags-proprietary-markers
  • https://stackoverflow.com/questions/27080961/how-to-remove-exif-tags-using-android-exifinterface
  • https://www.rmnof.com/article/exiftool-introduction/
  • https://exiftool.org/verbose.html

總結

以上是生活随笔為你收集整理的不丢失精度的获取照片的Gps经纬度的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。