zoukankan      html  css  js  c++  java
  • 通过图片获取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('******************************************************** ********************************************************')
    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()

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

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

     
     
     
  • 相关阅读:
    CentOS7安装MySQL5.7
    python基础 元组操作
    初识Python Python的历史(转)
    Python基础 基本数据类型
    createEvent 流沙
    GetLogicalDriveStringS获取驱动器根路径 流沙
    监控文件系统用得到的API 流沙
    Windows I/O 操作CreateFile 流沙
    脚本加入域 流沙
    WMI事件 流沙
  • 原文地址:https://www.cnblogs.com/shiguangliangchunshanbo/p/9745848.html
Copyright © 2011-2022 走看看