rinigus / pure-maps

Maps and navigation
https://rinigus.github.io/pure-maps/
GNU General Public License v3.0
243 stars 43 forks source link

Add automatic Track recording to GPX file #408

Open bokf opened 3 years ago

bokf commented 3 years ago

It would be nice, if Pure Maps could automatically save the acquired GPS positions to a GPX file. The position is known and it could save it to a file in the program folder. Standard for recording could be OFF in the options and only people who want to use it have to activate it in the options. Saving will be started automatically with the program and finished with closing the program. The file should be saved time by time (not only at the end), so in case of a unwanted program closing the GPX file is saved correctly and intact. I know this function from all my old Garmin devices and from Cachebox (Geocaching Software: https://sourceforge.net/projects/droidcachebox/). How often the position is recorded can be automatic, depending on time or distance, or simply according time. Disk space nowadays should be no problem, I think only one picture taken by the camera occupies more space than one whole day GPS/GPX recording.

bokf commented 3 years ago

The recorded track could also be displayed on the map. This helps on crossroads, when the map is turning, to know from which direction you arrived to the crossroads, or on hikes to know where you came from.

rinigus commented 3 years ago

I have been reluctant to add such functionality as recording GPX. There are other apps out there which are doing it just fine. In SFOS, we have https://gitlab.com/elBoberido/kuri (screenshots at https://openrepos.net/content/elboberido/kuri), on UT you have several as well: https://open-store.io/?sort=relevance&search=gpx. I prefer to have the apps that are doing some task and doing it well. Those GPX apps could do it better, focus on integration with online services and such.

To assist such apps, it is possible to use official QtLocation API or use a QML plugin that allows to make map apps simply: https://github.com/rinigus/mapbox-gl-qml . Kuri is using that QML plugin, in addition to its use by Pure Maps.

Now adding a "tail" following your movement is something that can be considered. It will have to be decided how long (space) and duration of it.

bokf commented 3 years ago

I tested Activity Tracker with UT several times and it is definitely not a reliable solution. It has to stay active in the background and stopped working at nearly all my tests. What I am looking for is a reliable start and forget solution for GPS tracking. At UT normally apps are not allowed to run in the background, so you need another app to force, that they can run in the background. Controlling if the app is still running is not possible because the position in this case is jumping hundreds of meters. As I don't have a flatrate internet connection on my mobile phone I use OSM scout server for offline navigation. To start navigation therefore it is necessary to run three (3) !!! apps for a function that could be done by one single app. But I can't judge how difficult it is from technical side to integrate this function.

rinigus commented 3 years ago

In general, I prefer to use tools for the task and not trying to do by a single tool. Due to client/server separation, one can use the same set of map data for multiple apps. Right now, uNav developer is checking out if he can use OSM Scout Server as well. Same approach was used on Sailfish for sports app.

In my mind, such suspending of apps on the background is a poor decision by UT. It kills Unix-type of approach to splitting tasks and using different tools for solving parts of the problem. Whether it will be revised, I don't know.

bokf commented 3 years ago

Just recording the track as a log is not the same as a fully featured track recorder with statistics. I have been using Garmin devices since 1999 and they just record the track as soon as you switch on the device and save it to a gpx file. This is a kind of diary for me. If I need statistics, I can do it out of this file on the PC.

Since 5 years I use OSMAnd and there you can start and stop recording and have statistics about length, time, ascend, descend, etc. and that is NOT the feature I am looking for.

In my opinion it is useful just to have a gpx file of the movements, while Pure Maps was open, without requiring any interaction like start, stop and save. If you could implement a Tail, it should not be so difficult to save this track points also to a log file?

rinigus commented 3 years ago

It is not very difficult, but just recording will probably not cut it. In addition, Pure Maps then will have to provide UI for managing GPX tracks (add/remove/rename/show selection). In part, GPX support is there via https://github.com/tkrajina/gpxpy that is used internally. So, it's the question of writing parts, hooking it into GUI. In this respect, we already have it in dedicated tracking apps and it is pity that UT does not allow you to properly use multiple apps at the same time without a special tweak tool.

With my backlog of issues, I am not going to work on it in any reasonable future. However, if someone is interested in it, I will merge PR with the implementation.

bokf commented 3 years ago

UI for managing the recordings in my opinion is not necessary. I could imagine an option in settings to activate logging and besides is written the path, where to find the logs. No more UI is necessary.

Cachebox for example has another folder in the "Tracks" folder called "Autoload". All gpx files that are in this folder are shown on the map (similar to the tail). It has no UI for the "Tracks" and "Autoload" folders.

I understand fully the problem of capacity to implement it (I don't understand the meaning of "I will merge PR with the implementation"), and appreciate your work on Pure Maps very much! In my opinion a good Navigation app is essential for a phone.

rinigus commented 3 years ago

"I will merge PR with the implementation" - if someone will write the code and submit it (pull request, PR), I will be happy to look into it and merge when it is ready. I don't expect to have time for that myself in near future, unfortunately.