Create your activity map based on heart rate zone
In this post, I will show you how to create a map with your cycling (or running) activity styling your route based on your heart rate. In green color you will see the segments where your heart rate was low (for example less than 120 bpm) and in red color where your heart rate was high ( for example greater than 150 bpm).
Retrieve your GPX file
If you like (or love) cycling and/or running and/or swimming and you are used to store your activities on Strava or other similar tools, you can download your activity in GPX format.
If you use Strava, at this URL: https://www.strava.com/athlete/training you see all your activities, sorted by date (latest activity on top of the list).
If you select an activity you can see the detail activity page.
On the left, on the sidebar, you have some shortcuts to edit the activity, to see analysis and you can access to some “advanced” functionalities via the “three dots” button.
In the context menu you can click “Export GPX” to download your activity in GPX format.
Now you have your GPX file in your local computer. You can proceed with the GPX — Geojson conversion.
Convert GPX into Geojson
For converting GPX file into Geojson you can use this opensource tool:
Drag and drop your GPX file into that tool.
Click on “Download” button. A Geojson file will be saved on your local computer.
Why do you need Geojson file? Because a lot of online tools use the Geojson file.
Create your Map based on your activity
With https://xyz.here.com/studio you can create your custom map based on Geojson file in easy way.
What is XYZ HERE Studio? If you need more information about XYZ HERE Studio you can jump there: https://explore.xyz.here.com/
On https://xyz.here.com/studio/ click on the button “Create new project” in top right of the screen. To do that you need to log in in XYZ Studio. If you don’t have any account you can create one for free. XYZ Studio has “Freemium plans” good for starting your work.
A new empty project (map) is created, and a new empty map is shown.
Add your data to map
Now you can add data (your Geojson file just created) clicking on “+ Add” on the left side bar of your new empty project.
In the new popup window “Add data” you can upload your Geojson file clicking on “Upload files” button
Once the file upload process is competed, you will see your new dataset available in “My XYZ Spaces”.
To load your data into the map, you need to make sure that the dataset is selected, and click on “Add 1 dataset” button.
Customize your project information
Once you have uploaded your data, you will see your project map. In the left panel you can change the project’s title and description.
Style your data
In order to style your data you need to access to the layer informations. On the left side panel click on the name of the layer.
In “Lines” section click “Add new style line” to open the “Add new style group” popup window. In this popup window, you can define:
- Style group name: set “Heart Rate LOW”;
- Property: select hr in the list (hr is the property for the heart rate);
- Condition: select “Less than”;
- Value: set a integer value (for example 120)
With this simple step you just created a rule for your lower heart rate (less than 120).
Click on “Confirm” button to save. Now you can define the style (color).
In the side bar you can see your new rule named “Heart Rate LOW”.
You can click the color picker and select the color. For example for lower rates you can select green color.
You will se in the map all segments where you ran with your heart rate less than 120 with green color.
In the same way, you can define and style a new rule for your higher heart rate segments.
On the left side bar click “Add new line style”.
In this popup window, you can define:
- Style group name: set “Heart Rate HIGH”;
- Property: select hr in the list (hr is the property for the heart rate);
- Condition: select “Greater than”;
- Value: set a integer value (for example 150)
Now you can select a color for styling segments that match your new rule.
If you created your 2 new style in the right way, you can see the left side bar with these styles for lines:
- Heart Rate HIGH
- Heart Rate LOW
- Default line style
You can rename “Default line style” clicking on the pencil close to the name. For example you can name it Heart Rate MEDIUM.
Publish your new map
In order to share your new styled map with your friends or in your blog, you need to publish it.
On the bottom of the left side panel click on the “Publish settings” button.
In the popup “Publish Settings” window, click on “Publish map”, select “Description” and “Legend” options and then scroll down the window.
Click on Open URL link. A new tab will be open with your published map.
You can see your workout activity on map, with coloured segments with your Heart Rate.
Now you can create your map activity based on your pace or on elevation. For cycling you can also style your map based on cadence or speed.
And now… it’s time to color your activities ;)
Feel free to leave your feedback or question as a comment.