<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Luka Steinbach</title>
    <description>The latest articles on DEV Community by Luka Steinbach (@luka1199).</description>
    <link>https://dev.to/luka1199</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F278973%2Fffa39ab7-a4e5-4823-bb53-61b320cd04f5.jpeg</url>
      <title>DEV Community: Luka Steinbach</title>
      <link>https://dev.to/luka1199</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luka1199"/>
    <language>en</language>
    <item>
      <title>How to generate a heat map from your google location data</title>
      <dc:creator>Luka Steinbach</dc:creator>
      <pubDate>Sun, 06 Sep 2020 11:29:26 +0000</pubDate>
      <link>https://dev.to/luka1199/how-to-generate-a-heat-map-from-your-google-location-data-mde</link>
      <guid>https://dev.to/luka1199/how-to-generate-a-heat-map-from-your-google-location-data-mde</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;It is known that Google tracks a lot of your data but many people don't know that you can actually download your data.&lt;/p&gt;

&lt;p&gt;You can download your data here: &lt;a href="https://takeout.google.com/"&gt;https://takeout.google.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I downloaded my location history I had a JSON file with about 14,000,000 lines and over 1,050,000 data points dating back to 2014.&lt;/p&gt;

&lt;p&gt;Why not use this data?&lt;/p&gt;

&lt;h1&gt;
  
  
  The Script
&lt;/h1&gt;

&lt;p&gt;So I wrote a Python script that generates a heat map from this data. &lt;/p&gt;

&lt;p&gt;GitHub repo: &lt;a href="https://github.com/luka1199/geo-heatmap"&gt;github.com/luka1199/geo-heatmap&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The results look like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SUb9r221--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k8s153ykv1rtqyl7o9bv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SUb9r221--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k8s153ykv1rtqyl7o9bv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To generate the heat map I used the Python library &lt;a href="https://python-visualization.github.io/folium/"&gt;Folium&lt;/a&gt;, which internally uses &lt;a href="https://leafletjs.com/"&gt;Leaflet.js&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Instructions on how to use the script are in the &lt;a href="https://github.com/luka1199/geo-heatmap/blob/master/README.md"&gt;README&lt;/a&gt; file of the repo or below.&lt;/p&gt;
&lt;h2&gt;
  
  
  Instructions
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Install Python 3+
&lt;/h3&gt;

&lt;p&gt;If you don't already have Python 3+ installed, grab it from &lt;a href="https://www.python.org/downloads/"&gt;https://www.python.org/downloads/&lt;/a&gt;. You'll want to download install the latest version of &lt;strong&gt;Python 3.x&lt;/strong&gt;. As of 2019-11-22, that is Version 3.8.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Get Your Location Data
&lt;/h3&gt;

&lt;p&gt;Here you can find out how to download your Google data: &lt;a href="https://support.google.com/accounts/answer/3024190?hl=en"&gt;https://support.google.com/accounts/answer/3024190?hl=en&lt;/a&gt;&lt;br&gt;
Here you can download all of the data that Google has stored on you: &lt;a href="https://takeout.google.com/"&gt;https://takeout.google.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To use this script, you only need to select and download your "Location History", which Google will provide to you as a JSON file by default.  KML is also an output option and is accepted for this program.&lt;/p&gt;

&lt;p&gt;You can also import &lt;a href="https://en.wikipedia.org/wiki/GPS_Exchange_Format"&gt;GPS Exchange Format (GPX)&lt;/a&gt; files,&lt;br&gt;
e.g. from a GPS tracker.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Clone The Repository
&lt;/h3&gt;

&lt;p&gt;On &lt;a href="https://github.com/luka1199/geo-heatmap"&gt;https://github.com/luka1199/geo-heatmap&lt;/a&gt;, click the green "Clone or Download" button at the top right of the page. If you want to get started with this script more quickly, click the "Download ZIP" button, and extract the ZIP somewhere on your computer.&lt;/p&gt;
&lt;h3&gt;
  
  
  4. Install Dependencies
&lt;/h3&gt;

&lt;p&gt;In a &lt;a href="https://tutorial.djangogirls.org/en/intro_to_command_line/#what-is-the-command-line"&gt;command prompt or Terminal window&lt;/a&gt;, &lt;a href="https://tutorial.djangogirls.org/en/intro_to_command_line/#change-current-directory"&gt;navigate to the directory&lt;/a&gt; containing this repository's files. Then, type the following, and press enter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Run The Script
&lt;/h3&gt;

&lt;p&gt;In the same command prompt or Terminal window, type the following, and press enter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;python geo_heatmap.py &amp;lt;file&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt;&amp;lt;file&amp;gt; ...]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Replace the string &lt;code&gt;&amp;lt;file&amp;gt;&lt;/code&gt; from above with the path to any of the following files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;Location History.json&lt;/code&gt; JSON file from Google Takeout&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Location History.kml&lt;/code&gt; KML file from Google Takeout&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;takeout-*.zip&lt;/code&gt; raw download from Google Takeout that contains either of the above files&lt;/li&gt;
&lt;li&gt;A &lt;a href="https://en.wikipedia.org/wiki/GPS_Exchange_Format"&gt;GPS Exchange Format (GPX)&lt;/a&gt; file&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
