import routes and favorite routes
  • HI
    Is there any chance that the mapfactor team adds an option to import routes from files like gpx or kml? It would be interesting to allow planning routes in advance.

    Also I do not find any option to store and retrieve the favorite routes. Any chance this can also be added?
  • 24 Comments sorted by
  • if you have the latest android version, you can import GPX files, just click on one and select Navigator
  • Yes, you can import a GPX file, but you can't say in Navigator that you want it to follow that route exactly (or at least follow the route that it is most similar to the route described in that GPS, e.g. in case it is inacurate), it only display the route in the map... nothing more...  nothing less.

    Also adding as i said previously any route to the favorites would be a nice feature to have :)
  • I think there was already discussion on this subject
    what happens if you track goes through restricted area, or there are no streets?

    you can add route to favourites in Route info
  • "what happens if you track goes through restricted area, or there are no streets?"

    Well that doesn't happened to me. I tried as an example using a route that i've used a few times, i've built it using google maps (dragging points), and exported it using a plugin, just to test this feature of Navigator. The route was exactly imported as expected. However i was expecting that Navigator asked me from the two opposite points from the route, what is the source and what is the destination, and then assume it as a route. And it doesn't asked it, just highlighted it in brown color. I tried to define manually the source and destination specified in the route that i've imported, and Navigator assumed the route that it thought would be better, not the one i've imported (it draws the blue line over some parts in common of the imported trace).

    I can assure you that the route is not a restricted area and there are streets there (if you allow tolls of course). In fact the streets appear in the OSM map used by Mapfactor. It is just an alternative route that imo is fastest since it avoids a big metropolitan area (Lisbon) and a lot of traffic, to get to a suburban area. Here, take a look at the file i'm using and test it.

    But answering your question, if there isn't a restricted area or streets missing, i would expect mapfactor to try to trace the route that is more similar to the one imported :). Hope i have made it more clear.

    "you can add route to favourites in Route info"

    Thank you, i didn't knew that.
  • What you show us is a track point file. Track point files have never been meant to be used as route files. For that you use either a waypoint file or preferably a route point file: please read wikipedia or better read the GPX standard on this.
    trackpoint files save your track every x seconds and normally contain some 500 to even 50.000 coordinates. They were never meant for calculating routes based on them.
    waypoint files are actually files to store your waypoints, and route files are really there to create a route, like say 3-20 route points. I fully agree that I would really like to see the option to use a route point (rte) file or a waypoint file (wpt) for routing.
    I don't think Tomas' arguments are valid when it comes to coordinates not accessible. If I put a destination inside a walking area, I can't create a route to my destination either. Simply give an error and leave it to the (not so smart) user: garbage in = garbage out.

    Note (16 Oct 2014): Not necessary anymore. Use RouteImporter.
    Anyway: I found a work around. Inside RouteConverter or any other application you want to use, you create your route having 2 to 5-15 points (what I do when creating a touristic route for myself during a holiday).
    I save this as a waypoint gpx and copy it to my SD-card. When tapping on it I can open it in Navigator. If you import all points it will create a folder inside your favorites (or favourites) where the folder name will be the file name of your gpx file and inside it all the waypoints in the correct order. Use the first as your starting point, the last as destination and the ones in between as waypoints. From the "Route Info" screen save this as a route and you're done. You can now (re-)calculate a route based on this saved route.
    It's not very user friendly, but it works fine (and if you want to keep it then regularly copy your favourites.xml and your route_points.xml to a safe location).
    Note (16 Oct 2014): Not necessary anymore. Use RouteImporter.

    And again: how would you expect any navigation app to calculate a route out of thousands of points (yours has approx 1300). How to decide which point is simply on a road and which point is on a junction and indicates a change of route. This would require a constant judgement of those points and which to use and where to add a voice command. This would require quite some CPU (and memory?) power.

    Edit: And simply converting your 1000+ coordinates containing trackpoint file into a waypoint or route file will not really help, even though that is possible.
  • thank you hvdwolf your answer was very helpful! :)
  • @hvdwolf:

    I'm pretty sure you forgot to mention the use of the route-importer app in your description of the workaround. Imprtorting gpx-data into MFN only generates gpx-files for viewing on map as racoq described, no routes in favorites.


  • Yes, thank you for the addition.
    But I only learned about that app today. It's new for me as well and indeed a better solution.
  • Sorry hvdwolf for offending you,

    did another test by explicitly converting data out of with RouteConverter to waypoints. Everything now working as you described. But IMHO not practically handable as a little motorbike daytrip will take about 40 routepoints. I found no way to simply group the "in-between-waypoints". I had to select them one after another. The use of the route importer app is more convenient.

  • Don't worry. You don't offend me. :)
    I too like the Importer much more then my own work around.
  • Thanks also from me hvdwolf. When I do a forum search it appears that many people would like the function to import a route-point or waypoint GPX file and be able to navigate using it. Hardly unreasonable - a basic function of most hardware GPS units. If the GPX file turns out to be a track point file then it is just displayed as currently, and for good reasons as you have explained. If Navigator duplicated the org.kadiba.routeimporter functionality then then it would surely satisfy most users requests.
  • Hi hvdwolf or gpo123 - can either of you provide an example of importing a route from a GPX file using RouteImporter? I have run this app but it gives an error message when I tap the Read Routes button, and text

    "Error: Error on line 3 of document file /mnt/sdcard/Android/data/com.mapfactor.navigator/files/navigator/gpx.test2.gpx. At line 3 column 2: uinbound prefix"

    The author of the app has not replied to my email. After reading this forum topic many times I still can't figure out how to read a GPX file and have it calculate as a route. Thanks in advance for any help.
  • Can you please show us the first 4 lines of your gpx file?
    An is it "uinbound prefix" or "inbound prefix"?
  • Here is the whole GPX file that I saved from MFN: I note the elements are track points not route points, even though it is a route I created within MFN. I seem to be missing the point of how your route importation process using RouteImporter is supposed to work although I desparately want a solution to this limitation.
  • Hi again hvdwolf. After a bit more investigation I now roughly understand the importation process. It wasn't clear from reading the discussion. For anyone else interested this is my current understanding:
    1. from 3rd party Android app RouteImporter choose the GPX file containing route point elements
    2. import the route
    3. the route is imported directly into the MFN database
    4. you can now load/ calculate/ delete this route from MFN > main menu > My Places > My Routes

    The important point in step 1 is that the GPX file contains route point elements not track point elements. Unfortunately, and confusing I think, from My Routes when you tap "Share as GPX" the route is saved to a file with track point elements not route point elements. RouteImporter cannot convert a GPX file containing track point elements and the error message is confusing to a dumb user like me.

    From main menu > Tools > Manage GPS files - I think it is reasonable the GPX files use track point elements, but in the list called "My Routes" I think it would be better that the file is saved with route point elements.
  • Hi,

    I checked your test.gpx but the format is wrong.
    The header is: 
    <?xml version='1.0' encoding='UTF-8' standalone='no' ?>

    That's correct.
    Then follows:
      <metadata navigator:version="1.3.24">
        <name>Created by MapFactor Navigator</name>
    That is wrong. I simply removed it from your track file and then it can be imported.

    Which application did create that gpx file? Was it navigator itself? 
    You definitely need to create a bug ticket for it.

  • Hi hvdwolf. Thanks for checking it. Yes, sadly, it was created with MFN ;-(
    I removed the from the file and it now works for me as well. So it didn't need to contain route points, track points work just as well?
  • Obviously the RouteImporter application converts track files to routable points in Navigator, which is nice (as long as there are not too much track points)
    However, I imported your file as well but I can't make a route out of it. Also when deleting the points and simply manually adding them as start, waypoint and destination navigator can't create a route. Are you sure all roads are connected or accessible to cars?

  • >Obviously the RouteImporter application converts track files to routable points
    it wasn't obvious to me, and the description in the play store doesn't distinguish between track and route points

    >but I can't make a route out of it
    my apologies, I had intentionally manually changed the GPS coordinates to not identify my home address

    when I did the test properly again, saved a route from MFN, deleted the metadata section, re-imported, and calculated, the route worked OK

    It would be nice if MFN could provide an Import GPX button instead of having to rely on RouteImporter because as I've said a few times there is no other way of sharing/ importing a route from another program; and from my forum search there were many others asking for instructions too.
  • >>Obviously the RouteImporter application converts track files to routable points
    >it wasn't obvious to me, and the description in the play store doesn't distinguish between track
    >and route points

    It only became obvious to me after the successful import.

    >when I did the test properly again, saved a route from MFN, deleted
    >the metadata section, re-imported, and calculated, the route worked OK

    How did you do that and from where? If you save a route from "Route Info" it will be stored as a set in your favourites.
    Tracks are managed from "Tools": Record, Replay, Manage GPX files
    If I do that (both from 1.3.24 or from 1.3.43) I don't get that <metadata> section.

  • I'm bumping this topic because something came up that IMHO is relevant for it and the original idea i had to be implemented in Mapfactor

    Graphopper (for those who don't know a well-known routing software/API), released version 0.4. Among the features there is "Snap to Road" that it is basically what i've proposed here in the first place:

    "There is now also a map matching component based on GraphHopper and released under the Apache License 2.0. This tool can be helpful if you need to track vehicles and import their GPX tracks which is helpful to “snap them to road”

    See the source:

    As i suggested in the first place it is possible, and the new release of graphopper proves it!
  • snapping is the easy bit, but what happens if you have nothing to snap to, or oneway street is reversed?
  • @Tomas: I don't think your aruments are correct.
    If it doesn't work then simply throw an error.
    Your argument is the same as: I want to plan a route from the Netherlands to Poland, but what if I don't have the Germany maps in between. Simple: it won't work and you throw an error (or time out). 
    In such circumstance you won't say:  I can't build a route app (MNF) because if a user does something stupid , how can I calculate a route?  (because no maps -> no routable roads. Like in your statement: "but what happens if you have nothing to snap to").

    It's the same with those gpx routes (or any externally created routes). If someone cycles illegally through a pedestrian area (and tracks it) it will not work, or if the road is there but it has not been mapped yet in OSM it will not work either. 
    That is always a risk with any mapping software even if you use TomTom maps, which are mostly less up-to-date regarding new (major) roads than OSM. 

    Of course I have no idea how to implement this or how difficult it is as you probably need to connect two different APIs. That would be a more valid argument to me: That MapFactor doesn't have the resources (money wise or people wise) to implement this. At least not on short term.
  • yes, you are quite right, I do repeat the same again and again, because I am convinced that it will create more problems then you can anticipate.
    I do not think that your comparison with missing maps is a good example
    lets say GPX trail runs through a newly created oneway road - of course, you can go around, but where do you rejoin GPX trail? Right behind the new obstacle, or find nearest point? Or best route to the last GPX point?
    And how far do you snap? What if a road is missing and the nearest link is on the other side of river, or railtrack?
    Users will not be happy with a half-baked solution.
    Please understand, I also would like this feature, but I think you underestimate potential problems

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion