This software allows streaming high resolution Strava Global Heatmap tiles with clients like QGIS, QMapShack, JOSM and many others without requiring them to be able to handle the Strava specific authentication and session management.
You can use the software either as static file configurator or as proxy server that handles the authentication on the fly.
With git, golang and make available on your system, the following steps are sufficient to build and install the binaries strava-heatmap-auth
and strava-heatmap-proxy
to the given path INSTALL_PREFIX
git clone https://github.com/patrickziegler/strava-heatmap-proxy
cd strava-heatmap-proxy
INSTALL_PREFIX=~/.local/bin make
The tools expect a config file located in ~/.config/strava-heatmap-proxy/config.json
containing Strava login credentials like shown below.
The option --config <path>
can be used to specify a custom location.
{
"Email": "...",
"Password": "..."
}
The tool strava-heatmap-auth
will read from stdin
, replace all occurences of %CloudFront-Key-Pair-Id%
, %CloudFront-Policy%
and %CloudFront-Signature%
tokens with the values retrieved as authentication cookie and write the result to stdout
.
This design allows us to provide a template TMS file like the following:
<TMS>
<Title>StravaHeatmap</Title>
<MinZoomLevel>3</MinZoomLevel>
<MaxZoomLevel>11</MaxZoomLevel>
<Layer idx="0">
<ServerUrl>https://heatmap-external-a.strava.com/tiles-auth/all/bluered/%1/%2/%3.png?v=19&Key-Pair-Id=%CloudFront-Key-Pair-Id%&Policy=%CloudFront-Policy%&Signature=%CloudFront-Signature%</ServerUrl>
</Layer>
</TMS>
And create the actual file with all %CloudFront-*%
tokens replaced by their correct values with the following pipeline:
cat StravaHeatmapAuth.tms.in | strava-heatmap-auth --config <path> | tee StravaHeatmapAuth.tms
Be aware that those parameters may expire after some time (about a week) and you will need to manually re-create the file with the command above.
The tool strava-heatmap-proxy
will set up a local proxy server for https://heatmap-external-a.strava.com/
.
Every request to http://localhost:8080/
(or a different port that you can configure via --port
) will then be extended with session cookies before being forwarded to Strava.
This design allows us to use a simple TMS file like shown below for fetching high resolution heatmap tiles:
<TMS>
<Title>StravaHeatmap</Title>
<MinZoomLevel>3</MinZoomLevel>
<MaxZoomLevel>11</MaxZoomLevel>
<Layer idx="0">
<ServerUrl>http://localhost:8080/tiles-auth/all/bluered/%1/%2/%3.png</ServerUrl>
</Layer>
</TMS>
- Discussion in bertt/wmts#2 revealed the meaning of
CloudFront-*
parameters - https://github.com/erik/strava-heatmap-proxy is following a similar approach but is designed to be a Cloudflare worker
This project is licensed under the GPL - see the LICENSE file for details