luka1199 / geo-heatmap

:world_map: Generate an interactive geo heatmap from your Google location data
MIT License
2.05k stars 226 forks source link

Non English formatted google services data #22

Closed vnckppl closed 4 years ago

vnckppl commented 4 years ago

When I ran the script and pointed to the .zip archive with the location data, I received the following error:

Loading data from ../data/takeout-20191130T173344Z-001.zip... Reading location data file from zip archive: 'Takeout/Locatiegeschiedenis/Locatiegeschiedenis.json' Traceback (most recent call last): File "./geo_heatmap2.py", line 179, in generator.run(data_file, output_file) File "./geo_heatmap2.py", line 135, in run self.load_zip_data(data_file) File "./geo_heatmap2.py", line 87, in load_zip_data self.loadJSONData(read_file) File "./geo_heatmap2.py", line 33, in loadJSONData data = json.load(json_file) File "/usr/lib/python3.5/json/init.py", line 268, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/usr/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes'

I think this is because geo_heatmap.py assumes a folder structure in the archive that uses English terms. If your Google services language is set to another language, these paths don't work out.

I was able to run geo_heatmap.py by first unzipping the archive and directly pointing to the .json file.