Sunday, September 8. 2019
Adding tags to runnerupweb
Another short entry to announce that these weeks I have been working in adding tags to my runnerup backend server. I missed the idea of tagging the activities with meaningful labels that I can use later to search of filter them. That feature has just been added. Remember that runnerupweb is just a toy project that I mainly use to do a backup of my running activities, do not think that it is a full application. My first idea was simply storing the TCX files into my nextcloud server, just that, but, as I already had something developed before, I continued with the idea in order to visualize and get some metrics from the workouts (once runalyze was closed).
The main idea about the tags is that activities can be labeled manually (the activity is marked by the user using the app) or automatically (when the TCX file is uploaded). So now the user can create tags that can be assigned to the workouts. The automatic tags are assigned to the training activity without user interaction and they are created receiving an activity as a sample (that means that the automatic tag takes an activity to obtain some info from it, then the tag can check if another one is assignable or not). The current automatic tags inside the app are the following:
Sport: This tag just checks the sport type of the activity and assign a label to it (running, biking,...).
Location: This tag takes the first track-point of the TCX file and checks if the activity is inside a specific radius (I wanted this because sometimes I run in several cities and I wanted to automatically tag the activities with the city).
Regular expression: Simple tag that uses a PHP regexp over the notes of the TCX file. For example if a tag is created using the expression /race/i any activity uploaded with the word race inside the notes will be tagged with this label.
Route: This is the more complex tag and really the goal I wanted to achieve. I usually do different routes when running (mainly three) and I wanted to automatically tag the TCX file with the route done. The idea is the tag uses the sample activity to get N points and then calculate the distance between the original points and the new activity points, if the accumulated distance is less than a tolerance error (indeed a percent of the distance), the new activity is labeled with the route tag.
Speed and Distance: Another two simple tags that just tag the new activity based on the average speed (for example less than 5 minutes per kilometer) or the total distance of the training (more than 10 km).
Here I present some pictures of how the tags look.
List of user tags:
Using tag filter in the activity list:
Tags inside the activity:
Now I have to upgrade my desktop (real) application. Create my tags and then re-calculate all my files to automatically assign the labels to them. Let's see how it works. If I see no big problems a new tag 0.2.0 will be created for the project.
Regards.
Comments