Configuring OsmAnd maps of the Strava heatmap layer

    The OsmAnd application for Android phones has the ability to add additional layers to OSM (Open Street Map) maps. A useful addition to your navigation system will be the Strava heatmap layer, the result of the tracks of runners, cyclists, swimmers recorded during travel and training. Visualization of this data allows one to find the most popular routes highlighted by impressive lanes on the one hand, and to determine the patency or passability of a site on the ground by thin threads of single tracks.

    Since 2018, Strava labs has been providing only low-resolution tails in the public domain. This happened, apparently, to "ensure security" in response to publications about the mass declassification of the location of user training.

    To search for popular routes, low detailing is quite enough, but in order to assess whether we pass a section of the terrain, we need single-track records.

    I will give an example. The screenshot of the phone’s screen shows that the descent along the path down from Mount Akhun to Agursky Falls (1) is a fairly popular walking and cycling route (attention, only for extreme bike riders!). But to overcome the slope 1.5 km from the road to the top of Akhuna to the Devil's Gate canyon (2) on the Khosta river, the final point of the Yew-boxwood trail (3), with all the seductiveness of such a walk, it is unlikely to succeed. As the map approaches, it will be seen from the single tracks that there were attempts of such an obvious challenge, but all ended unsuccessfully.



    Connect OsmAnd Strava heatmap in low resolution


    Let's figure out how to set up the Strava heatmap layer on your smartphone. To connect the heatmap in OsmAnd in low resolution, create a new source for the layer (Menu -> Configure Map -> Map Source -> Set / Edit ...)



    Name the new layer, for example, HeatMap cycling (not detailed)
    Set the URL for downloading the tiles:
    https://heatmap-external-{switch:a,b,c}.strava.com/tiles/cycling/bluered/{0}/{1}/{2}.png?px=256
    tiles/ - местоположение для анонимных тейлов
    cycling/ - тейлы велотренировок, можете также установить представления ride, both, all
    bluered/ - цветовая палитра, существуют еще варианты hot, grey
    ?px=256  - размер тейла для OsmAnd
    


    You can choose the appropriate layer view in OsmAnd by switching the settings on the Strava map.



    For hiking, for example, set up a bluered palette, and for a bicycle hot and switch depending on your trip. The differences between these "hitmaps" are minimal, but sometimes these differences are important. Where there is a mountain trail and you can go, it is not always possible to drive.

    Setting the Strava heatmap detail layer


    To display detailed tiles in your OsmAnd, you will need to specify a different path to the images (/ tiles-auth /) and add authorization parameters to the link, which we will take from browser cookies.

    Link example:
    
    https://heatmap-external-{switch:a,b,c}.strava.com/tiles-auth/running/bluered/{0}/{1}/{3}.png?px=256&Key-Pair-Id={ID}&Signature={Sig}&Policy={P}
    Где:
    {0} = zoom
    {1} = x*
    {2} = y*
    {ID} = CloudFront-Key-Pair-Id
    {Sig} = CloudFront-Signature
    {P} = CloudFront-Policy
    

    * The zoom, x, and y values ​​are automatically set when using the OsmAnd card.
    Learn more about the coordinates of Google map tiles here .

    To obtain authorization parameters, log in to your Strava.com account and copy the appropriate cookie values. In Chrome, type in the address bar: chrome: // settings / cookies / detail? Site = strava.com. To view cookies in Firefox, press Shift + F9.

    An example of the value of the Front-Policy field to add to the URL.



    When copying cookies, pay attention to the validity period in order to replace them in a timely manner.

    In addition, there is an option that eliminates the need to replace the cookie in the application once every 2 weeks. The article describes the solution by link to automatically generate an authorized request for detailed layers. Automatic authorization on the Strava Heatmap card . By the way, I did not find such a thing on the English-language Internet.

    Perhaps someone will offer other options for an authorized request to Strava Heatmap cards, for example, based on OSMAnd itself. Write about this in the comments.

    Set the transparency of the coverage map; using this slider, you can adjust the optimal appearance of the map.

    Watch the size of the data / net.osmand / files / tiles folder where downloaded maps are cached. I have accumulated 0.5 Gb in 2 weeks of use. When deleting folders with images of maps of different sizes, delete the .metainfo file, but save the directory (the name of your layer).



    Finally


    Customize your maps in OsmAnd, enjoy popular itineraries, look for difficult, but interesting, carefully plan to overcome places where no one has visited or traveled before. Interesting and safe travel for you!

    Also popular now: