通过图片获取gps地理位置


别人说通过一张照片就可以定位你的位置,看来个视频,仔细研究了一下自己的照片没想到真的可以做到,想想真的有点可怕。

如何通过一张照片去定位这张照片的经纬度下面我以我手机中的照片为例。

我们通过python3 去读取照片的信息  下面是我用python3写的代码

 
import exifread
import re

def imageread():
GPS = {}
date = ''
f = open("E:\\2.jpg",'rb')
imagetext = exifread.process_file(f)
for key in imagetext: #打印键值对
print(key,":",imagetext[key])
print('********************************************************\n********************************************************')
for q in imagetext: #打印该图片的经纬度 以及拍摄的时间
if q == "GPS GPSLongitude":
print("GPS经度 =", imagetext[q],imagetext['GPS GPSLatitudeRef'])
elif q =="GPS GPSLatitude":
print("GPS纬度 =",imagetext[q],imagetext['GPS GPSLongitudeRef'])
elif q =='Image DateTime':
print("拍摄时间 =",imagetext[q])

imageread()

将这个经纬度转化一下。将转换的结果上网查一下。

以上就是通过图片进行的定位的过程。

 
 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM