aidenpearce369 / exif-gps-tracer Goto Github PK
View Code? Open in Web Editor NEWA python script which allows you to parse GeoLocation data from your Image files stored in a dataset.It also produces output in CSV file and also in HTML Google Maps
A python script which allows you to parse GeoLocation data from your Image files stored in a dataset.It also produces output in CSV file and also in HTML Google Maps
So I scraped a bunch of photos, put it into a folder and then put the folder as the dataset and initially got this:
PS C:\Users\1\Documents\scripts\exif-gps-tracer> py plotmap.py
# # # # ###### # # ##### #### # ##### ## #### ###### #####
# # # # # # # # # # # # # # # # # # #
##### ## # ##### ##### # #### # # #### ##### # # # # # # ##### # #
# ## # # # # ##### # # ##### ###### # # #####
# # # # # # # # # # # # # # # # # # # #
####### # # # # ##### # #### # # # # # #### ###### # #
[+] Enter path for your dataset : D:\1\2\3\
No EXIF metadata found for D:\1\2\3\/file1.jpg
Traceback (most recent call last):
File "C:\Users\1\Documents\scripts\exif-gps-tracer\plotmap.py", line 21, in <module>
gps,time=getdata()
File "C:\Users\1\Documents\scripts\exif-gps-tracer\getdata.py", line 13, in getdata
gpstags = get_gpstags(exif,filename)
File "C:\Users\1\Documents\scripts\exif-gps-tracer\getexif.py", line 25, in get_gpstags
UnboundLocalError: local variable 'geotagging' referenced before assignment
Pretty much, it wasn't going to the next file. I'm thinking it's because there was no exif data, so python bugged out when it tried to return the variable geotagging. I simply went into the getexif.py file and added 'else: geotagging = 0' like this, so that the variable was given a value and python wouldn't freak out:
def get_gpstags(exif,filename):
if not exif:
print("No EXIF metadata found for "+filename)
if exif:
geotagging = {}
for (idx, tag) in TAGS.items():
if tag == 'GPSInfo':
if idx not in exif:
print("No EXIF GeoTag found on "+filename)
break
for (key, val) in GPSTAGS.items():
if key in exif[idx]:
geotagging[val] = exif[idx][key]
else:
geotagging = 0
return geotagging
After this, it seemed to go through all the files (unfortunately no exif data in any of them so I couldn't test further). Then the script printed this and stopped:
Data processed from the given datasets
CSV file created successfully...(tracedlocation.csv)
Traceback (most recent call last):
File "C:\Users\1\Documents\scripts\exif-gps-tracer\plotmap.py", line 41, in <module>
gmap = gmplot.GoogleMapPlotter(gps[l-1][0],gps[l-1][1],30,apikey=API_KEY)
File "C:\Users\1\AppData\Local\Programs\Python\Python39\lib\site-packages\gmplot\gmplot.py", line 390, in __init__
self.center = (float(lat), float(lng))
TypeError: float() argument must be a string or a number, not 'NoneType'
I'm guessing this is because there were no values for gps data that it could parse. I'm guessing had there been GPS data, it would have finished up fine, but I don't have any pictures with exif data to test this on, unfortunately. Otherwise, looks like a pretty cool program that you made. Hopefully I'll be able to use it on something in the future (especially since I went out of my way to make a Google Maps Javascript API key).
[+] Enter path for your dataset : /home/joker2020/Downloads/index.jpeg/
Traceback (most recent call last):
File "/home/Makali/soft/exif-gps-tracer/plotmap.py", line 21, in
gps,time=getdata()
File "/home/Makali/soft/exif-gps-tracer/getdata.py", line 6, in getdata
file_data=scanfiles(path)
File "/home/Makali/soft/exif-gps-tracer/scanfiles.py", line 6, in scanfiles
fnames = os.listdir(path)
NotADirectoryError: [Errno 20] Not a directory: '/home/Makali/Downloads/index.jpeg/'
Gps
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.