![]() Lst_when = track_elements.findall("kmlns:when", namespaces=ns) Track_elements = root.find("kmlns:Document/kmlns:Placemark/gx:Track", namespaces=ns) # track_elements = root.find("kmlns:Placemark/gx:Track", namespaces=ns) # Read the Google location history *.kml file and yield the geotags between the start and end date Json.dump(geotags, outfile, indent=4, default=str) # function hook for parsing the "geotag" objects from JSON filesĭef load_geotags_from_json_hook(pairs, format="%Y-%m-%d %H:%M:%S%z"):ĭ = (v, format)ĭef store_geotags_to_json(json_file, geotags): Geotags = json.load(open(json_file, "r"), object_pairs_hook=load_geotags_from_json_hook) # Load geotags stored in a json file in the aforementioned "geotag" object format # to create a single instance to be used in loops etc. # When using functions that require an exiftool instance, use e.g.: ![]() # a "geotag" object is a dictionary with this entries: The code is only rudimentary but might be useful as a starting point for others: # I called this script "GeotagHandling.py" and imported functions in the script below. Personally I wanted a little more control over what happens, so I wrote some python code to handle Google's location history, combine it with geotags from other pictures and than apply the list of geotags to my pictures where I can adjust allowed difference in timestamps and also approximate positions between valid timestamps.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |