UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to import a gpx.track into pure maps/Unav?

    Scheduled Pinned Locked Moved Solved Support
    17 Posts 5 Posters 1.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • hankschwieH Offline
        hankschwie
        last edited by hankschwie

        Is there a way to import gpx tracks to use them with pure maps (or unav)? I can't find anything in the settings, can't open the track with either application from the filemanager. Is it possible?

        1 Reply Last reply Reply Quote 1
        • N Offline
          NoelFlantier
          last edited by

          Yes it is possible, just open pure maps, open the navigation menu (third icon at the bottom), then tap on the three dots on the top right hand corner and open the first line popping up which should be something like "using Stadia maps",
          change it for GPX, and you are good to go,
          now instead of a point A To point B in navigation you are offered to open a GPX file stored on your device

          hankschwieH 1 Reply Last reply Reply Quote 2
          • hankschwieH Offline
            hankschwie @NoelFlantier
            last edited by

            @NoelFlantier
            Thanks! What a perfectly hidden feature! I knew I had seen something about gpx, but couldn't find it. It works, now I can get on tour with my bicycle 🙂

            1 Reply Last reply Reply Quote 0
            • R Offline
              rinigus
              last edited by

              I suspect that I need to make a website for Pure Maps to show features like that. If you use Pure Maps with offline maps server, you have access to "GPX Smart" router as well. The smart version will take your GPX, feed it to the router in OSM Scout Server for processing, and will give you back GPX trace matched to the route network (for bikes should be paths) and instructions (as turn left/right/...).

              hankschwieH 1 Reply Last reply Reply Quote 0
              • hankschwieH Offline
                hankschwie @rinigus
                last edited by

                @rinigus
                Very good idea! 👍

                "GPX smart" works great if the route is just "one-way"; when I try to render a gpx-track which consists of routes that are circular or include alternative ways only a part is shown, which unfortunatly isn't very smart ;-). Perhaps you could have a look into that? Or should I open an issue someplace?

                1 Reply Last reply Reply Quote 0
                • R Offline
                  rinigus
                  last edited by

                  Please open an issue at https://github.com/rinigus/pure-maps

                  Navigation part I would like to rewrite, in part started already. Sounds like it's related.

                  hankschwieH 1 Reply Last reply Reply Quote 0
                  • hankschwieH Offline
                    hankschwie @rinigus
                    last edited by

                    @rinigus
                    I found the reason, at least for some of the problems. gpx smart fails when it encounters an "impossible" situation (e.g. the gpx track leads across a street which is not supposed to be crossed; or wants to lead through a one-way-street in the wrong direction; older tracks might have small errors because streets have changed, or an u-turn wasn't corrected after a wrong turn had occurred when recording the original gpx-track ; a round trip had the start and end point overlapping, so gpx smart just connected the short distance between those two points :beaming_face_with_smiling_eyes: ). So the solution here could be a more tolerant error handling.

                    I was able to fix some tracks using GpsPrune, but that is really cumbersome...

                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      rinigus
                      last edited by

                      @hankschwie

                      The way GPX smart works is that it is using Valhalla's map matching - demo at https://www.mapzen.com/products/mobility/map-matching/

                      Which is it's strength and, as you have seen, weakness in some conditions. For it to work, you are expected to give correct mode of transportation (you can walk in the both directions along one-way street, but don't do it while driving).
                      In this respect I think it works as expected.

                      As for a use of older tracks where street direction has changed, not sure it is of such use for driving then either. I would say that there is no need to be tolerant in this respect and lead to the situation where you are driving and guided to do illegal turn...

                      1 Reply Last reply Reply Quote 0
                      • R Offline
                        rinigus
                        last edited by

                        As an additional note: not sure what is the status of GPX viewers on UT. From one POV, I would like to keep Pure Maps focussed and as simple as possible. Maybe some other app can be used for general GPX viewing or do the users expect to have such functionality from maps app?

                        hankschwieH magdesignM 2 Replies Last reply Reply Quote 0
                        • hankschwieH Offline
                          hankschwie @rinigus
                          last edited by hankschwie

                          @rinigus
                          Please keep the gpx-features, its just great for hiking or bicycle trips. Right now I'm planing bicycle trips, which works ok, as long as the tracks don't include cross country parts on fields or similar.

                          Correcting tracks is an option to use older tracks (as provided by my android ADFC bicycle map app, which is able to export the tracks).

                          1 Reply Last reply Reply Quote 0
                          • R Offline
                            rinigus
                            last edited by

                            I will, sure as it is now. Let's see if there will be requests and use cases to extend it. But that would have to be discussed before implementing.

                            1 Reply Last reply Reply Quote 0
                            • magdesignM Offline
                              magdesign @rinigus
                              last edited by magdesign

                              @rinigus: I would love to use it for offline navigation for mountain biking in the mountains.
                              Have a lot of GPX tracks from friends and I am thinking of creating some kind of Supertrail maps where all the nice biketrails are visible in offline mode.
                              Not sure if here is the right place to ask, but would it be possible to overlay all stored gpx files over a map with height lines (opentopomap.org) or should I render them somehow into a hi-res map and then load this custom map? Any hints are very welcome.

                              Oneplus 6 (A6003)
                              UBports 16.04 RC 2021-W32

                              R 1 Reply Last reply Reply Quote 0
                              • R Offline
                                rinigus @magdesign
                                last edited by

                                @magdesign That's a bit more sophisticated than usual.

                                In principle, it is possible, but you will have to get your hands dirty. Overall, you will have to

                                1. convert GPX tracks to something that the map widget can load natively (GeoJSON)
                                2. serve that GeoJSON via local HTTP server (python simplehttp?)
                                3. create new style that is using GeoJSON and serve it via the same server
                                4. add new map to Pure Maps as a custom map

                                As OSM Scout Server does not have height lines, you would have to either look how to add isolines data to these maps via your style or download tiles from opentopomap and serve via your server as well.

                                Not very trivial, but possible. All depends on how much time do you want to invest into it. As a nice side effect, you will learn how it works and could contribute to the map data import and style development.

                                1 Reply Last reply Reply Quote 0
                                • H Offline
                                  herr-b
                                  last edited by

                                  This is somehow similar to the "autoload" of gpx tracks we discussed on github:

                                  The program Cachebox for example has a folder called "Autoload". All gpx files that are in this folder are loaded at program start and shown on the map. It has no UI for the "Autoload" folder, only shows the tracks as an overlay over the map. Each track has a different colour to distinguish them from each other.

                                  R 1 Reply Last reply Reply Quote 0
                                  • R Offline
                                    rinigus @herr-b
                                    last edited by

                                    @herr-b, that would solve the problem as described by @magdesign. Any developers around wishing to write it?

                                    1 Reply Last reply Reply Quote 0
                                    • magdesignM Offline
                                      magdesign
                                      last edited by

                                      @rinigus :Thanks for the summary of steps.
                                      Since I will never go back to android I think I must spend time for solving this problem.

                                      @herr-b : this sounds like a great solution.

                                      Oneplus 6 (A6003)
                                      UBports 16.04 RC 2021-W32

                                      R 1 Reply Last reply Reply Quote 0
                                      • R Offline
                                        rinigus @magdesign
                                        last edited by

                                        @magdesign If you are going to work on https://github.com/rinigus/pure-maps/issues/408, that would resolve most of your issue with only remaining part being isolines. But for isolines we could maybe find some better solution

                                        1 Reply Last reply Reply Quote 0
                                        • magdesignM magdesign referenced this topic on
                                        • magdesignM magdesign referenced this topic on
                                        • First post
                                          Last post