Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts

I wrote a python script that generates a geo heatmap from your Google location data (source code and instructions in comments) [OC]


I wrote a python script that generates a geo heatmap from your Google location data (source code and instructions in comments) [OC]

Post image
98% Upvoted
Log in or sign up to leave a commentlog insign up
level 1
Original Poster300 points · 7 days ago · edited 7 days ago

Data from:

Source code:

(Instructions in the Readme)

Edit: I've added some links to the Readme ("4. Install Dependencies") for people with no experience in using the command prompt or terminal.

level 2
11 points · 7 days ago · edited 7 days ago

I can't figure out how to do this tbh. The website has great instructions on getting to the desktop folder but nowhere else. *Edit I fixed that by just copying the files directly to my desktop.

When I type pip install -r requirements.txt it gives an error that Pip is not a valid instruction.

Then when I try to run the script python <file> it claims the syntext is not correct.

level 2

It’s strongly encouraged to create a license. Get job on the github

level 2

Thank you!

level 2
5 points · 7 days ago · edited 7 days ago

If python isn't running correctly take a look at

It's a pain but you have to sometimes insert the environment variables to make things run.

And if you are using powershell remember a dot slash may be required to run a script.

level 2
OC: 13 points · 7 days ago

Yo man. Having no knowledge of anything, it took me about 45 minutes and I just wanted to say thank you. This is super cool. I've got location data for the past 5 or 6 years on takeout, and it's super neat to see places I've been, how long, etc...

I finally did get it to work, but I had to more my locationhistory.json into the python folder, as well as the github download. I got to the "python <file>" step, and couldn't get past it.... so I don't know why, or what I was doing wrong, but I ended up putting the github download, and the json into c:\python and typed "python locationhistory.json" and BAM.

I've now spent a good 15 minutes moving around the USA seeing all the places I've been. And again. Thank you.

level 2

Will give it a try, thanks for sharing!

level 2

Which data specifically? It's a long list, I couldn't make out straight away which data contains your location history.

level 2
2 points · 5 days ago

I suspect my .json was too large (654 MB) since even installing the 64 bit version of python still gave me MemoryError. Used this site to do it and here are the results.

level 2

I'll try it out soon. Cheers.

level 2

Hey, thanks for this! Took just a few minutes to figure it out but it worked perfectly.

Do you know if there's any way to get the final html file to load quicker when moving around/zooming in? Is it limited by my computer's processor/graphics card?

level 2

Thanks for this! I'm so close...

I got to enter " .\ h o 2019-09-12 2019-09-30 'OpenStreetMap' C:\Users\me\Downloads\Map Italy Trip\takeout.tgz " but it opens up PyCharm and says webbrowser is undefined?

What do I need to change? the Directory or define something?

level 1
93 points · 7 days ago

i have absolutely no experience with python, and barely any with coding in general. i cant seem to figure out how to navigate to the directory containing the repository's contents. i'm using the commandscreen that pops up when you open python, after freshly installing it. anybody that could help me out?

level 2
OC: 1110 points · 7 days ago

If you want an easier version of this (no disrespect to the work by op), use

level 2

Here's what you need to know to get past that challenge:

  1. When you're in a command terminal/prompt/screen, you're always in some directory on your computer as far as the command terminal is concerned. See this image. Notice how I'm in "C:\Users\danrb"?

  2. If I were to type run pip install -r requirements.txt in the command prompt I showed in the image earlier, it would look for a file named C:/Users/danrb/requirements.txt. That file doesn't exist on my computer though, so it would return an error.

  3. You need to make your terminal navigate to the directory you cloned from OP's github. How you do that depends on your operating system and possibly some other stuff. Since you're not familiar with command terminals, I think it's safe to assume you're using Windows. The easiest way is to open up the cloned repository, then hold Shift and then right click inside the repo's folder in Windows. The context menu should say something like "Open PowerShell Window Here" or perhaps "Open command window here". Use that. An alternative way is to use the cd path/to/directory command in the command terminal. This will allow you to navigate to any folder on your Windows PC from within the terminal. cd stands for "change drive/directory".

  4. Once you're in the cloned repo, do pip install -r requirements.txt and it should succeed, assuming you have pip and python installed on your PC correctly.

More posts from the dataisbeautiful community
Continue browsing in r/dataisbeautiful





Feb 14, 2012

Cake Day

A place for visual representations of data: Graphs, charts, maps, etc. DataIsBeautiful is for visualizations that effectively convey information. Aesthetics are an important part of information visualization, but pretty pictures are not the aim of this subreddit.
Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies. Learn More.