<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>map &#8211; www.musings.ch</title>
	<atom:link href="https://www.musings.ch/tag/map/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.musings.ch</link>
	<description></description>
	<lastBuildDate>Sat, 11 Apr 2020 10:09:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://www.musings.ch/wp-content/uploads/2020/02/cropped-56884-200-2-32x32.png</url>
	<title>map &#8211; www.musings.ch</title>
	<link>https://www.musings.ch</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>COVID-19: daily heatmap</title>
		<link>https://www.musings.ch/2020/03/19/covid-19-daily-heatmap/</link>
		
		<dc:creator><![CDATA[random individual]]></dc:creator>
		<pubDate>Thu, 19 Mar 2020 18:58:43 +0000</pubDate>
				<category><![CDATA[cartography]]></category>
		<category><![CDATA[covid-19]]></category>
		<category><![CDATA[switzerland]]></category>
		<category><![CDATA[coronavirus]]></category>
		<category><![CDATA[heatmap]]></category>
		<category><![CDATA[map]]></category>
		<guid isPermaLink="false">https://www.musings.ch/?p=306</guid>

					<description><![CDATA[Thanks to the awesome work of Daniel Probst, collecting per canton data and publishing it on https://github.com/daenuprobst/covid19-cases-switzerland, I was able to pull this quick heatmap together, showing latest (ie daily) confirmed cases of COVID-19 in Switzerland, updated constantly (whenever source data changes). note: unreported cantonal data is backfilled from the previous day (previous post on&#8230; <a class="more-link" href="https://www.musings.ch/2020/03/19/covid-19-daily-heatmap/">Continue reading <span class="screen-reader-text">COVID-19: daily heatmap</span></a>]]></description>
										<content:encoded><![CDATA[
<div id="map" style="height: 500px;"></div>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAxkqrVUwcSHsEXM301sgGGc6XH_ju6l9o&amp;libraries=visualization"></script>

<script>
var cantons = {
  AG: {location: new google.maps.LatLng(47.409703, 8.154694), weight: 0, name: 'Aargau'},
  AI: {location: new google.maps.LatLng(47.317264, 9.416754), weight: 0, name: 'Appenzell Innerrhoden'},
  AR: {location: new google.maps.LatLng(47.366352, 9.36791), weight: 0, name: 'Appenzell Ausserrhoden'},
  BE: {location: new google.maps.LatLng(46.823608, 7.636667), weight: 0, name: 'Bern'},
  BL: {location: new google.maps.LatLng(47.45176,  7.702414), weight: 0, name: 'Basel-Landschaft'},
  BS: {location: new google.maps.LatLng(47.564869, 7.615259), weight: 0, name: 'Basel-Stadt'},
  FR: {location: new google.maps.LatLng(46.718391, 7.074008), weight: 0, name: 'Fribourg'},
  GE: {location: new google.maps.LatLng(46.220528, 6.132935), weight: 0, name: 'Geneva'},
  GL: {location: new google.maps.LatLng(46.981042, 9.065751), weight: 0, name: 'Glarus'},
  GR: {location: new google.maps.LatLng(46.656248, 9.628198), weight: 0, name: 'Graubünden'},
  JU: {location: new google.maps.LatLng(47.350744, 7.156107), weight: 0, name: 'Jura'},
  LU: {location: new google.maps.LatLng(47.067763, 8.1102), weight: 0, name: 'Luzern'},
  NE: {location: new google.maps.LatLng(46.995534, 6.780126), weight: 0, name: 'Neuchatel'},
  NW: {location: new google.maps.LatLng(46.926755, 8.405302), weight: 0, name: 'Nidwalden'},
  OW: {location: new google.maps.LatLng(46.854527, 8.244317), weight: 0, name: 'Obwalden'},
  SG: {location: new google.maps.LatLng(47.2332, 9.274744), weight: 0, name: 'Sankt Gallen'},
  SH: {location: new google.maps.LatLng(47.71357, 8.59167), weight: 0, name: 'Schaffhausen'},
  SO: {location: new google.maps.LatLng(47.304135, 7.639388), weight: 0, name: 'Solothurn'},
  SZ: {location: new google.maps.LatLng(47.061787, 8.756585), weight: 0, name: 'Schwyz'},
  TG: {location: new google.maps.LatLng(47.568715, 9.091957), weight: 0, name: 'Thurgau'},
  TI: {location: new google.maps.LatLng(46.295617, 8.808924), weight: 0, name: 'Ticino'},
  UR: {location: new google.maps.LatLng(46.771849, 8.628586), weight: 0, name: 'Uri'},
  VD: {location: new google.maps.LatLng(46.570091, 6.657809), weight: 0, name: 'Vaud'},
  VS: {location: new google.maps.LatLng(46.209567, 7.604659), weight: 0, name: 'Valais'},
  ZG: {location: new google.maps.LatLng(47.157296, 8.537294), weight: 0, name: 'Zug'},
  ZH: {location: new google.maps.LatLng(47.41275, 8.65508), weight: 0, name: 'Zurich'},
};

jQuery(document).ready(function() {
  function getData() {
    return [
      jQuery.ajax({
          type: "GET",
          url: "https://api.github.com/repos/daenuprobst/covid19-cases-switzerland/contents/covid19_cases_switzerland.csv",
          headers: {'Accept': 'application/vnd.github.v3.raw'},
          dataType: "text",
          success: function(data) {processData(data);}
       }),
      jQuery.ajax({
          type: "GET",
          url: "https://api.github.com/repos/daenuprobst/covid19-cases-switzerland/contents/covid19_cases_switzerland_openzh.csv",
          headers: {'Accept': 'application/vnd.github.v3.raw'},
          dataType: "text",
          success: function(data) {processData(data);}
       }),
    ];
  }
  getData();
});

function processData(csvData) {
  var csvDataLines = csvData.split(/\r\n|\n/).filter(item => item);
  var keys = csvDataLines[0].split(',');
  //var values = csvDataLines[csvDataLines.length - 1].split(',');
  // account for datasource switching between , and ;
  var sep = (csvDataLines.indexOf(';') > 0) ? ';' : ',';
  // extra loop to backfill empties (use last known)
  for (var j = 0; j < csvDataLines.length; j++) {
    row = csvDataLines[j].split(sep);
    for (var i = 0; i < keys.length; i++) {
      var cases = parseInt(row[i]);
      if (keys[i] in cantons) {
        if (cases > 0) {
          cantons[keys[i]].weight = cases;
        }
      }
    }
  }
  plotheatmap(cantons);
  plotchart();
}

function plotheatmap(cantons) {
  var heatmapData = [];
  for (canton in cantons) { heatmapData.push(cantons[canton]); }
  var heatmapCenter = new google.maps.LatLng(46.798476, 8.231787);

  map = new google.maps.Map(document.getElementById('map'), {
    center: heatmapCenter,
    zoom: 7,
    mapTypeId: 'roadmap'
  });

  var heatmap = new google.maps.visualization.HeatmapLayer({
    data: heatmapData
  });
  heatmap.setMap(map);
  heatmap.set('radius', 22);
  heatmap.set('maxIntensity', 100);
  heatmap.set('opacity', 0.8);
  var gradient = [
    'rgba(0,255,255,0)',
    'rgba(35,34,65,1)',
    'rgba(59,58,98,1)',
    'rgba(80,79,128,1)',
    'rgba(96,95,150,1)',
    'rgba(112,111,172,1)',
    'rgba(130,130,198,1)',
    'rgba(146,146,221,1)',
    'rgba(164,164,247,1)',
    'rgba(165,170,246,1)',
    'rgba(166,177,245,1)',
    'rgba(167,185,243,1)',
    'rgba(168,195,241,1)',
    'rgba(170,205,239,1)',
    'rgba(171,212,238,1)',
    'rgba(172,218,237,1)',
    'rgba(199,245,255,1)',
  ];
  heatmap.set('gradient', gradient);
}
</script>



<p class="wp-block-paragraph">Thanks to the awesome work of <a href="https://github.com/daenuprobst">Daniel Probst</a>, collecting per canton data and publishing it on <a href="https://github.com/daenuprobst/covid19-cases-switzerland">https://github.com/daenuprobst/covid19-cases-switzerland</a>, I was able to pull this quick heatmap together, showing latest (ie daily) confirmed cases of COVID-19 in Switzerland, updated constantly (whenever source data changes).</p>



<p class="wp-block-paragraph"><strong>note:</strong> unreported cantonal data is backfilled from the previous day</p>



<p class="wp-block-paragraph">(previous post on this topic: <a href="https://www.musings.ch/2020/03/13/covid-19-heatmap-schweiz/">https://www.musings.ch/2020/03/13/covid-19-heatmap-schweiz/</a>)</p>



<div id="chart_div" style="height: 500px;"></div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
function plotchart() {
  google.charts.load('current', {
    'packages': ['geochart'],
    'mapsApiKey': 'AIzaSyAxkqrVUwcSHsEXM301sgGGc6XH_ju6l9o'
  });
  google.charts.setOnLoadCallback(drawRegionsMap);
}

function drawRegionsMap() {
  var provincemapData = [['Canton', 'Count']];
  for (canton in cantons) {
    provincemapData.push([cantons[canton].name, cantons[canton].weight]);
  }
  var data = google.visualization.arrayToDataTable(provincemapData);
  var options = {
    region: 'CH',
    displayMode: 'regions',
    resolution: 'provinces',
    defaultColor: '#87d7fa',
    colorAxis: {minValue: 0, colors: ['#87d7fa', '#0075a8']}
  };
  var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
  chart.draw(data, options);
}
 </script>



<p class="wp-block-paragraph">And since heatmaps over broad areas are not necessarily useful, here&#8217;s a map of cantons affected.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>swisstopo is art</title>
		<link>https://www.musings.ch/2020/02/25/swisstopo-is-art/</link>
		
		<dc:creator><![CDATA[random individual]]></dc:creator>
		<pubDate>Tue, 25 Feb 2020 09:07:42 +0000</pubDate>
				<category><![CDATA[art]]></category>
		<category><![CDATA[cartography]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[swisstopo]]></category>
		<guid isPermaLink="false">https://www.musings.ch/?p=113</guid>

					<description><![CDATA[I have a bunch of friends over at swisstopo and I always considered them artists &#8211; little did I know about the true level of artistry that goes into their beautiful maps: https://eyeondesign.aiga.org/for-decades-cartographers-have-been-hiding-covert-illustrations-inside-of-switzerlands-official-maps/]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I have a bunch of friends over at <a href="https://www.swisstopo.admin.ch/">swisstopo</a> and I always considered them artists &#8211; little did I know about the true level of artistry that goes into their beautiful maps:</p>



<a href="https://eyeondesign.aiga.org/for-decades-cartographers-have-been-hiding-covert-illustrations-inside-of-switzerlands-official-maps/" target="_blank" rel="noopener noreferrer">https://eyeondesign.aiga.org/for-decades-cartographers-have-been-hiding-covert-illustrations-inside-of-switzerlands-official-maps/</a>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>all garmin activities on a map</title>
		<link>https://www.musings.ch/2020/02/24/all-garmin-activities-on-a-map/</link>
		
		<dc:creator><![CDATA[random individual]]></dc:creator>
		<pubDate>Mon, 24 Feb 2020 20:24:19 +0000</pubDate>
				<category><![CDATA[code]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[garmin]]></category>
		<category><![CDATA[kml]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[mymaps]]></category>
		<category><![CDATA[visualization]]></category>
		<guid isPermaLink="false">https://www.musings.ch/?p=108</guid>

					<description><![CDATA[After further scouring through my data export from Garmin Connect (see https://www.musings.ch/2020/02/22/all-garmin-tracks-on-a-map/), I found ${username}_${index?}_summarizedActivities.json, which contains all activities I ever recorded. 😃 That one contains 468 usable startLongitude/startLatitude elements, which fits nicely into kml as Placemark and renders well on https://www.google.com/mymaps. The resulting map: Which also works well zooming in: Again, drop me a&#8230; <a class="more-link" href="https://www.musings.ch/2020/02/24/all-garmin-activities-on-a-map/">Continue reading <span class="screen-reader-text">all garmin activities on a map</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">After further scouring through my data export from Garmin Connect (see <a href="https://www.musings.ch/2020/02/22/all-garmin-tracks-on-a-map/">https://www.musings.ch/2020/02/22/all-garmin-tracks-on-a-map/</a>), I found ${username}_${index?}_summarizedActivities.json, which contains all activities I ever recorded. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f603.png" alt="😃" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p class="wp-block-paragraph">That one contains 468 usable startLongitude/startLatitude elements, which fits nicely into kml as Placemark and renders well on <a href="https://www.google.com/mymaps">https://www.google.com/mymaps</a>.</p>



<p class="wp-block-paragraph">The resulting map:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps.png"><img fetchpriority="high" decoding="async" width="1024" height="557" src="https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps-1024x557.png" alt="" class="wp-image-109" srcset="https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps-1024x557.png 1024w, https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps-300x163.png 300w, https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps-768x418.png 768w, https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps.png 1027w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>all my Garmin activities anchored in a location, plotted on a map using kml Pacemarks</figcaption></figure></div>



<p class="wp-block-paragraph">Which also works well zooming in:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1004" height="619" src="https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps-zoomed.png" alt="" class="wp-image-110" srcset="https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps-zoomed.png 1004w, https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps-zoomed-300x185.png 300w, https://www.musings.ch/wp-content/uploads/2020/02/garmin-activities-as-kml-on-mymaps-zoomed-768x473.png 768w" sizes="(max-width: 1004px) 100vw, 1004px" /><figcaption>zoomed in view of all my Garmin activities in a specific region</figcaption></figure>



<p class="wp-block-paragraph">Again, <a href="https://www.musings.ch/contact/">drop me a note</a> if you feel I could help you with any of this.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>all garmin tracks on a map</title>
		<link>https://www.musings.ch/2020/02/22/all-garmin-tracks-on-a-map/</link>
					<comments>https://www.musings.ch/2020/02/22/all-garmin-tracks-on-a-map/#comments</comments>
		
		<dc:creator><![CDATA[random individual]]></dc:creator>
		<pubDate>Sat, 22 Feb 2020 10:32:03 +0000</pubDate>
				<category><![CDATA[code]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[garmin]]></category>
		<category><![CDATA[fit]]></category>
		<category><![CDATA[heatmap]]></category>
		<category><![CDATA[kml]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[visualization]]></category>
		<guid isPermaLink="false">https://www.musings.ch/?p=14</guid>

					<description><![CDATA[Today I had some fun exporting all my recorded Garmin tracks and plotting them as a heatmap on Google Maps. After having wanted to create a map like this for ages, I finally found some time to hack together the toolchain needed. If you want to do the same, the easiest way I&#8217;ve found was:&#8230; <a class="more-link" href="https://www.musings.ch/2020/02/22/all-garmin-tracks-on-a-map/">Continue reading <span class="screen-reader-text">all garmin tracks on a map</span></a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><a href="https://www.musings.ch/wp-content/uploads/2020/02/garmin-tracks-on-worldmap.png"><img decoding="async" width="912" height="522" src="https://www.musings.ch/wp-content/uploads/2020/02/garmin-tracks-on-worldmap.png" alt="garmin tracks plotted on a map of the world" class="wp-image-79" srcset="https://www.musings.ch/wp-content/uploads/2020/02/garmin-tracks-on-worldmap.png 912w, https://www.musings.ch/wp-content/uploads/2020/02/garmin-tracks-on-worldmap-300x172.png 300w, https://www.musings.ch/wp-content/uploads/2020/02/garmin-tracks-on-worldmap-768x440.png 768w" sizes="(max-width: 912px) 100vw, 912px" /></a><figcaption>everywhere in this world I&#8217;ve run, biked, hiked, skied, swum</figcaption></figure>



<p class="wp-block-paragraph">Today I had some fun exporting all my recorded Garmin tracks and plotting them as a heatmap on Google Maps.</p>



<p class="wp-block-paragraph">After having wanted to create a map like this for ages, I finally found some time to hack together the toolchain needed. If you want to do the same, the easiest way I&#8217;ve found was:</p>



<p class="wp-block-paragraph">#1 Ask Garmin for an export of all your data: <a href="https://www.garmin.com/en-US/account/datamanagement/">https://www.garmin.com/en-US/account/datamanagement/ </a></p>



<p class="wp-block-paragraph">#2 Use the fabulous <a href="https://github.com/polyvertex/fitdecode">https://github.com/polyvertex/fitdecode</a> to extract the lat/longs of your tracks.</p>



<p class="wp-block-paragraph">#3 Use  the Google Maps heatmap API to plot the data: <a href="https://developers.google.com/maps/documentation/javascript/reference/visualization">https://developers.google.com/maps/documentation/javascript/reference/visualization</a></p>



<p class="wp-block-paragraph">Alternatively, <a href="https://www.musings.ch/contact/">drop me a line</a>, and I&#8217;d be happy to help <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p class="wp-block-paragraph">You might wonder how to plot all your tracks on a map &#8211; which is what I initially started with. However, with 346 recorded activities, using kml to plot them (through various platforms) I found it difficult to navigate the result. &#8211; If you&#8217;d like to get your fit files converted to kml to play around with them, also <a href="https://www.musings.ch/contact/">drop me a note</a>, I have a converter for that too.</p>



<p class="wp-block-paragraph">A close up view (without adjusting radius, maxIntensity,.. so not optimal):</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="https://www.musings.ch/wp-content/uploads/2020/02/sf-closeup-heatmap.png"><img loading="lazy" decoding="async" width="618" height="261" src="https://www.musings.ch/wp-content/uploads/2020/02/sf-closeup-heatmap.png" alt="Zooming in, this is how the heatmap fits to specific routes beautifully." class="wp-image-103" srcset="https://www.musings.ch/wp-content/uploads/2020/02/sf-closeup-heatmap.png 618w, https://www.musings.ch/wp-content/uploads/2020/02/sf-closeup-heatmap-300x127.png 300w" sizes="auto, (max-width: 618px) 100vw, 618px" /></a><figcaption>close up view of the heatmap of a specific area</figcaption></figure></div>



<p class="wp-block-paragraph"><strong>Update:</strong> I&#8217;ve uploaded the script to generate a javascript include on github: <a href="https://github.com/musings-hub/garmin-fit-to-heatmap-js">https://github.com/musings-hub/garmin-fit-to-heatmap-js</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p class="wp-block-paragraph"><strong>Update:</strong> I&#8217;ve updated the script to generate content to run on <a href="https://jsfiddle.net/">jsfiddle</a>: <a href="https://www.musings.ch/2020/02/26/garmin-tracks-heatmap/">https://www.musings.ch/2020/02/26/garmin-tracks-heatmap/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.musings.ch/2020/02/22/all-garmin-tracks-on-a-map/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
