Schweiz: Kantonsmittelpunkte

Die Latitude und Longitude der Kantonsmittelpunkte der Schweiz, als .csv:

Aargau, 47.409703, 8.154694                       
Appenzell-Ausserrhoden, 47.366352, 9.36791        
Appenzell-Innerrhoden, 47.317264, 9.416754        
Basel-Landschaft, 47.45176, 7.702414              
Basel-Stadt, 47.564869, 7.615259                  
Bern, 46.823608, 7.636667                         
Fribourg, 46.718391, 7.074008                     
Geneva, 46.220528, 6.132935
Glarus, 46.981042, 9.065751
Graubรผnden, 46.656248, 9.628198
Jura, 47.350744, 7.156107
Luzern, 47.067763, 8.1102                         
Neuchatel, 46.995534, 6.780126                    
Nidwalden, 46.926755, 8.405302                    
Obwalden, 46.854527, 8.244317                     
Schaffhausen, 47.71357, 8.59167                   
Schwyz, 47.061787, 8.756585
Solothurn, 47.304135, 7.639388                    
St-Gallen, 47.2332, 9.274744                      
Thurgau, 47.568715, 9.091957                      
Ticino, 46.295617, 8.808924                       
Uri, 46.771849, 8.628586
Valais, 46.209567, 7.604659
Vaud, 46.570091, 6.657809
Zug, 47.157296, 8.537294
Zurich, 47.41275, 8.65508

Quellen: https://de.wikipedia.org/wiki/Mittelpunkt_der_Schweiz#Kantonsmittelpunkte und https://tools.wmflabs.org/

COVID-19: Heatmap Schweiz

Since I was playing with Google Maps API heatmaps recently, I thought I’d put together a quick heatmap showing confirmed COVID-19 cases in Switzerland.

COVID-19 cases per 100k inhabitants, in Switzerland, as of 2020-03-19.

Updated 19.03.2020 using https://www.bag.admin.ch/dam/bag/de/dokumente/mt/k-und-i/aktuelle-ausbrueche-pandemien/2019-nCoV/covid-19-lagebericht.pdf.download.pdf/COVID-19_Epidemiologische_Lage_Schweiz.pdf – now based on incidence of cases per 100k inhabitants.

Day to day developments:

2020-03-14:

COVID-19 heatmap Switzerland 2020-03-14

Updated 14.03.2020 using https://www.bag.admin.ch/dam/bag/de/dokumente/mt/k-und-i/aktuelle-ausbrueche-pandemien/2019-nCoV/covid-19-lagebericht.pdf.download.pdf/COVID-19_Epidemiologische_Lage_Schweiz.pdf

2020-03-13:

COVID-19 heatmap Switzerland 2020-03-13

Data source: https://www.bag.admin.ch/bag/de/home/krankheiten/ausbrueche-epidemien-pandemien/aktuelle-ausbrueche-epidemien/novel-cov/situation-schweiz-und-international.html#-1934206868

garmin tracks heatmap

If you want to create your own heatmap – but lack a webserver – I’ve updated the script shared earlier to allow generating content to run on jsfiddle.

a screenshot of jsfiddle, with a heatmap of your garmin track locations

How to plot a heatmap of your Garmin tracks on Google Maps JS API:

#1 request all your data from Garmin: https://www.garmin.com/en-US/account/datamanagement/

#2 download https://github.com/musings-hub/garmin-fit-to-heatmap-js

#3 run it: python3 fit-to-js-threaded.py ./Garmin/fit/

This will generate a file named “heatmap-datapoints.js“.

#4 open heatmap-datapoints.js and copy the contents into jsfiddle (see screenshot above).

#5 update the javascript to include your own API key for Google Maps API (see https://developers.google.com/maps/documentation/javascript/get-api-key for how to get such a key if you don’t have one already).

#6 click “Run” in jsfiddle.

#7 admire the heatmap of your location based activities ๐Ÿ˜Š

all garmin activities on a map

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:

all my Garmin activities anchored in a location, plotted on a map using kml Pacemarks

Which also works well zooming in:

zoomed in view of all my Garmin activities in a specific region

Again, drop me a note if you feel I could help you with any of this.

all garmin tracks on a map

garmin tracks plotted on a map of the world
everywhere in this world I’ve run, biked, hiked, skied, swum

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’ve found was:

#1 Ask Garmin for an export of all your data: https://www.garmin.com/en-US/account/datamanagement/

#2 Use the fabulous https://github.com/polyvertex/fitdecode to extract the lat/longs of your tracks.

#3 Use the Google Maps heatmap API to plot the data: https://developers.google.com/maps/documentation/javascript/reference/visualization

Alternatively, drop me a line, and I’d be happy to help ๐Ÿ™‚

You might wonder how to plot all your tracks on a map – 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. – If you’d like to get your fit files converted to kml to play around with them, also drop me a note, I have a converter for that too.

A close up view (without adjusting radius, maxIntensity,.. so not optimal):

Zooming in, this is how the heatmap fits to specific routes beautifully.
close up view of the heatmap of a specific area

Update: I’ve uploaded the script to generate a javascript include on github: https://github.com/musings-hub/garmin-fit-to-heatmap-js ๐Ÿ™‚

Update: I’ve updated the script to generate content to run on jsfiddle: https://www.musings.ch/2020/02/26/garmin-tracks-heatmap/