Author Topic: Offline navigation - GraphHopper - preparation  (Read 111205 times)

Offline john_percy

  • Master of Locus
  • ****
  • Posts: 664
  • Thanked: 93 times
    • View Profile
  • Device: MotoG
Re: Offline navigation - GraphHopper - preparation
« Reply #75 on: April 23, 2015, 14:46:00 »
Yes and two more missing features ... one way roads and roundabouts. Anyway to be true I do not know if any of these issue is solved ...
Give us a new version and new data and we'll find out
I have just tested the latest version of GraphHopper on Emux's Atlas and it seems to know and respect roundabouts and one way streets.
 

Offline Tomáš Janoušek

  • Newbie
  • *
  • Posts: 6
    • View Profile
  • Device: Samsung Galaxy S3
Re: Offline navigation - GraphHopper - preparation
« Reply #76 on: May 07, 2015, 02:05:15 »
Hello everyone,

as I was not very happy with the routes from MapQuest and YOURS and the other engines didn't have either instructions or a bicycle profile, I decided to give GraphHopper a try. Naturally I didn't want to use an old version of GraphHopper and OSM data, so I had to write a few lines of code myself. I ended up creating two things (in that order):

  • a command line converter from GraphHopper Directions API JSON written in Haskell (not very useful as you need to get those JSONs somewhere, e.g. using a Chrome dev console)
  • a JavaScript implementation of the same thing, usable as a bookmarklet (essentially a one click solution that turns a route planned on graphhopper website into a gpx importable into Locus)

Usage:

If no gpx is downloaded, there should be an error in the developer console.

I'm sorry if things don't work or if the usage is strange. This is my first javascript since almost forever. Nevertheless I hope this may be useful for someone else as well. :-)
 

Offline Andrew Heard

  • Master of Locus
  • ****
  • Posts: 672
  • Thanked: 24 times
    • View Profile
  • Device: Samsung Galaxy A5 Oreo/8, Lenovo Note 4 Nougat/7.1
Re: Offline navigation - GraphHopper - preparation
« Reply #77 on: May 07, 2015, 05:28:07 »
Very interesting post Tomáš. Why did you choose GraphHopper instead of BRouter? For me offline BR with Locus has the advantage I can (with support from clever people) modify the selected fastbike.brf profile to suit local conditions (eg. cycling allowed on motorway, add more cost to gravel track) whereas with offline GH with Locus the rules & costs are not modifyable by an "ordinary" user, and there is no script customization possible. The script ability of BR has made its routing choices near to perfect.
 

Offline Tomáš Janoušek

  • Newbie
  • *
  • Posts: 6
    • View Profile
  • Device: Samsung Galaxy S3
Re: Offline navigation - GraphHopper - preparation
« Reply #78 on: May 07, 2015, 12:08:49 »
Andrew, I didn't abandon BRouter completely. It stays as my engine of choice for offline route planning, although I haven't experimented with customizing the profiles yet. Anyway it's fine for planning medium range sport rides which I can memorize. However, on longer rides in unknown territory I'd much prefer to have good spoken navigation instructions and that simply isn't possible with BRouter. I know it's quite a limitation that I need to plan these routes online on graphhopper website, but for my intended usecase (long rides from A to B) it's okay.

But yeah, a customizable profile and offline routing with GraphHopper would be better, and I believe we'll get there in a few months/years. I just wanted to hack something together to have more options. Also, to be honest, I feel that the customizable profile might be a bit overrated, especially in our area where many roads/tracks are just guesses from low-res orthophoto maps that are years old and were never updates or modified afterwards (*). It's nice to have perfect routing, but it's not that useful if it's in an imaginary world. :-)

(*) I'd like to fix that but I have yet to figure out a way to do so. When I plan a sport ride I certainly don't want to stop every 500 meters to compare a map with reality and take notes. Carrying a GoPro in timelapse mode, uploading to Mapillary and fixing the map afterwards seems like a solution, but I'll need to make a habit out of it: the few times I tried it added a lot of overhead as well so I usually leave it at home and enjoy the ride instead. And I may need to get a few additional batteries. :-)
 

Offline Andrew Heard

  • Master of Locus
  • ****
  • Posts: 672
  • Thanked: 24 times
    • View Profile
  • Device: Samsung Galaxy A5 Oreo/8, Lenovo Note 4 Nougat/7.1
Re: Offline navigation - GraphHopper - preparation
« Reply #79 on: May 07, 2015, 12:51:40 »
Fascinating, thanks for the discussion. I didn't realize GH provided street names back to Locus. There are so many things that are only discovered the hard way because there isn't a comparison table. I gave up with GH because it chose a silly route along a gravel track of the same length as a quiet paved road right next to it. When I asked the GH developers they showed me where in the Java code to modify behavior, and agreed that bringing that logic out to a script would be nice, but no time soon. Hacking the BR profile for our local laws & my preferences was a great step forward.

Planning the routes online is a dream compared to offline. I wish it were easier.

I am finding the same comparing navigation and guiding modes - subtle differences that are not documented in just one easy to compare table. I've got a 1200km cycle sport ride in France in August, but the track planning was definitely not done by a routing engine. Every turn would have been physically planned & checked. I have a dyno on the front wheel, so batteries aren't a concern to me ;-)
« Last Edit: May 29, 2015, 00:40:24 by gynta »
 

Offline Bucky Kid

  • Padavan of Locus
  • ***
  • Posts: 304
  • Thanked: 5 times
    • View Profile
Re: Offline navigation - GraphHopper - preparation
« Reply #80 on: June 08, 2015, 11:56:02 »
GH works better than MapQuest for me, however is there possibility for newer routing data (or way to create them from some online available data). I think uodate would be nice  :)
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11355
  • Thanked: 293 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Offline navigation - GraphHopper - preparation
« Reply #81 on: June 22, 2015, 02:29:17 »
Uff new data, see first post. I've not tested it so hope it will work. And now excuse me, bed is calling ...
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Bucky Kid

  • Padavan of Locus
  • ***
  • Posts: 304
  • Thanked: 5 times
    • View Profile
Re: Offline navigation - GraphHopper - preparation
« Reply #82 on: June 22, 2015, 08:41:15 »
Awesome, thanks. Could we have a guide how to use the generator (I assume it serves for creating offline routing data from online source if I'm right)?
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11355
  • Thanked: 293 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Offline navigation - GraphHopper - preparation
« Reply #83 on: June 22, 2015, 09:28:16 »
Yup, from OSM data. Description is in the link in first topic. Section "maps" contains few steps so use "generator.zip" from Google Drive for this task.

I still see there few major limitations
- for car - it is not simply possible to ignore highways
- generally it is not possible to route over more data files at once
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline john_percy

  • Master of Locus
  • ****
  • Posts: 664
  • Thanked: 93 times
    • View Profile
  • Device: MotoG
Re: Offline navigation - GraphHopper - preparation
« Reply #84 on: June 22, 2015, 13:00:19 »
Great. If anyone is interested I downloaded the British Isles routing data as described, as an osm.pbf file from http://download.geofabrik.de/ (it's a Special Region at the bottom of the Europe page) and generated GraphHopper files (actually using a function built in to Atlas but I'm sure it would work as menion describes) and now have offline routing in Locus across the whole of the British Isles. I'm happy.

« Last Edit: June 22, 2015, 13:35:54 by john_percy »
 

Offline tommi

  • Global Moderator
  • Professor of Locus
  • *****
  • Posts: 1223
  • Thanked: 2 times
  • Devices: Samsung S7 + S5 + S3 + Nexus7 flo
    • View Profile
Re: Offline navigation - GraphHopper - preparation
« Reply #85 on: June 24, 2015, 21:59:25 »
Hi Menion,
referring to your english post in the german part of the forum, precisely this one:
http://forum.locusmap.eu/index.php?topic=4661.msg37837#msg37837
I have problems with graphhopper data folder on external sd card.
I've placed all my vector maps at
/storage/extSdCard/LocusMassData/mapsVector
according http://www.locusmap.eu/locus-run-since-update-device-android-4-4-2-kitkat/#solutionC .

The vector maps are in sub folders for the continents. Locus is happy to use the vector maps from there.

In the same folder /storage/extSdCard/LocusMassData/mapsVector I have put the folder _germany.osm-gh
So it looks like:
/storage/extSdCard/LocusMassData/mapsVector/Europe/*.map
/storage/extSdCard/LocusMassData/mapsVector/_germany.osm-gh

The Graphhopper Addon doesn't find its data folder and complains I should place the data at /storage/emulated/0/Locus/mapsVector.
If I put the _germany.osm-gh to the recommended location in the Locus folder, GraphHopper Addon finds its data folder and I can use the router..
But due to free space limits I want to put all those bulk data to external storage.

As Balloni did, I deleted  the app data of GraphHopper addon. Next time I started the addon again it showed me the hint to put the data to internal storage as before.

Any idea?
Thanks,
Tommi
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11355
  • Thanked: 293 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Offline navigation - GraphHopper - preparation
« Reply #86 on: June 24, 2015, 22:35:20 »
tommi, this is correct behavior.

Locus, better "add-on" search for it's data in defined ROOT directory for Locus vector maps. By default, it is in Locus/mapsVector. You may anyway define this root directory to your SD card - http://docs.locusmap.eu/doku.php?id=manual:user_guide:settings:misc - "default directories" settings.

This say to Locus, that Locus/mapsVector is no longer used and for all operations is used directory on SD card. So also themes, also POIs, also maps. Anyway, warning - if you download maps from Locus Store, this will ends on some bad error probably, because Locus Store won't be able to write downloaded data to this directory.

Another alternative, from my point of view best in case of vector maps, is to place this "mapsVector" directory on SD card into /android/data/menion.android.locus(.pro)/files/... directory. Here have Locus full read/write access!! - check solution B http://www.locusmap.eu/locus-run-since-update-device-android-4-4-2-kitkat/#solutionB . Just keep in mind to not un-install Locus otherwise this directory will be deleted!

Helped?
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline john_percy

  • Master of Locus
  • ****
  • Posts: 664
  • Thanked: 93 times
    • View Profile
  • Device: MotoG
Re: Offline navigation - GraphHopper - preparation
« Reply #87 on: June 24, 2015, 23:52:55 »
@menion: I think @tommi needs clarification on where the GraphHopper data should be put.
I have a gh folder at the same level as the map, which works. However the reference page seems to suggest that the map should be in the folder with the GraphHopper data.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 11355
  • Thanked: 293 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Offline navigation - GraphHopper - preparation
« Reply #88 on: June 25, 2015, 07:18:58 »
hmm where you see that "map should be in the folder with the GraphHopper data"?

System is really simple. Directory Locus/mapsVector is container for all Locus vector (mapsForge) maps. And in same directory should be routing data for graphHopper. It is the place, were add-on search for them. No matter how deep (nested subfolders) they are, add-on just search for directories that ends with "-gh".
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline john_percy

  • Master of Locus
  • ****
  • Posts: 664
  • Thanked: 93 times
    • View Profile
  • Device: MotoG
Re: Offline navigation - GraphHopper - preparation
« Reply #89 on: June 25, 2015, 08:25:34 »
hmm where you see that "map should be in the folder with the GraphHopper data"?

System is really simple. Directory Locus/mapsVector is container for all Locus vector (mapsForge) maps. And in same directory should be routing data for graphHopper. It is the place, were add-on search for them. No matter how deep (nested subfolders) they are, add-on just search for directories that ends with "-gh".
See the link "how to generate routing data" in your first post; then point 4: put berlin.map in the same folder as your routing data.