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

Offline Bucky Kid

  • Padavan of Locus
  • ***
  • Posts: 296
  • Thanked: 5 times
    • View Profile
Re: Offline navigation - GraphHopper - preparation
« Reply #240 on: June 18, 2018, 13:16:55 »
Is it somehow possible to generate single custom .pbf file based on own region in order to seamlessly cross the borders?
 

Offline develar

  • More than Newbie
  • *
  • Posts: 12
  • Thanked: 6 times
    • View Profile
  • Device: Doogee S60
Re: Offline navigation - GraphHopper - preparation
« Reply #241 on: June 18, 2018, 13:49:19 »
> generate single custom .pbf file based on own region in order to seamlessly cross the borders?

You can specify required for you countries and I will add specified region to https://graphhopper.develar.org

In general, you need to draw wanted region using http://geojson.io, download europe.pbf from some public  source (http://download.geofabrik.de/index.html),  and then

```
osmium extract --overwrite --config=extracts.json --strategy=smart europe-latest.osm.pbf
```

where extracts.json something like https://github.com/develar/gh-routing-data/blob/master/configs/extracts.json

and then build graph for result pbf file.

Since Locus is so awesome, I think it is not good that users need to do such low-level tasks to enjoy offline navigation, that's why I suggest you to file issue to https://github.com/develar/gh-routing-data/issues and I will add wanted region to provided list (main problem not first import, but keep it up to date).
 
The following users thanked this post: Bucky Kid

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 10652
  • Thanked: 160 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Offline navigation - GraphHopper - preparation
« Reply #242 on: June 25, 2018, 01:45:15 »
@develar
firstly, really nice work. I'm sure, many users appreciate it.

Just published version 0.7 of GH add-on.
Main change: using latest stable GH API 0.10
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 
The following users thanked this post: Bucky Kid, develar

Offline Bucky Kid

  • Padavan of Locus
  • ***
  • Posts: 296
  • Thanked: 5 times
    • View Profile
Re: Offline navigation - GraphHopper - preparation
« Reply #243 on: June 25, 2018, 07:20:16 »
@menion: I can't find the updated version, is it still here?
https://nas.asamm.com/share.cgi?ssid=0GmHJnN

@develar: thanks for the method, my region is specific and not aligned exactly on country borders, so there will be probably a small target, and I use different set of wehicles
« Last Edit: June 25, 2018, 07:46:46 by Bucky Kid »
 

Offline develar

  • More than Newbie
  • *
  • Posts: 12
  • Thanked: 6 times
    • View Profile
  • Device: Doogee S60
Re: Offline navigation - GraphHopper - preparation
« Reply #244 on: June 25, 2018, 08:15:55 »
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 10652
  • Thanked: 160 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Offline navigation - GraphHopper - preparation
« Reply #245 on: June 25, 2018, 08:51:52 »
Ah thanks, I've updated the first post and hope it is ok for you @develar, that I pointed users directly on your web server.
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 
The following users thanked this post: develar

Offline Bucky Kid

  • Padavan of Locus
  • ***
  • Posts: 296
  • Thanked: 5 times
    • View Profile
Re: Offline navigation - GraphHopper - preparation
« Reply #246 on: June 25, 2018, 19:08:31 »
Thanks develar for updated link, do you know where to get Windows binaries for osmium tool?
I am unable to compile from sources.
 

Offline develar

  • More than Newbie
  • *
  • Posts: 12
  • Thanked: 6 times
    • View Profile
  • Device: Doogee S60
Re: Offline navigation - GraphHopper - preparation
« Reply #247 on: June 25, 2018, 19:16:52 »
@Bucky Kid Please see https://ci.appveyor.com/api/buildjobs/skx61j610842y80u/artifacts/osmium_Release_x64.zip

Issue https://github.com/osmcode/osmium-tool/issues/59 is opened. I don't test it (I use macOS).

> I am unable to compile from sources.

Process is not easy. That's why I created http://graphhopper.develar.org/ and any user can request any region to be added to avoid low-level things.
 
The following users thanked this post: Bucky Kid

Offline Bucky Kid

  • Padavan of Locus
  • ***
  • Posts: 296
  • Thanked: 5 times
    • View Profile
Re: Offline navigation - GraphHopper - preparation
« Reply #248 on: June 26, 2018, 11:47:50 »
osmium extract --overwrite --config=extracts.json --strategy=smart europe-latest.osm.pbf
Finally got everything to work, but this is not working, instead I had to uise

osmium extract --polygon extracts.json ....

or also works

osmium merge -o my-europe.osm.pbf country1-latest.osm.pbf country2-latest.osm.pbf country3-latest.osm.pbf ...

however anyway I brush up against problem of memory limitation so wasn't able to generate combined routing data even only for 3 countries, so seamless routing will only be possible by adding support for automatic region selection in graphopper app.
 

Offline develar

  • More than Newbie
  • *
  • Posts: 12
  • Thanked: 6 times
    • View Profile
  • Device: Doogee S60
Re: Offline navigation - GraphHopper - preparation
« Reply #249 on: June 26, 2018, 12:07:30 »
@Bucky Kid

> however anyway I brush up against problem of memory limitation so wasn't able to generate combined routing data even only for 3 countries, so seamless routing will only be possible by adding support for automatic region selection in graphopper app.

`export JAVA_OPTS="-Xmx15g -Xms10g -XX:+UseG1GC"`

where `15g` it is `available RAM - 1GB` (1GB for system). Change `-Xms10g`  if you don't have 10GB.

and if your machine doesn't have enough memory (estimate: num of encoders * size of input map), use MMAP instead of RAM_STORE.

Or you can stop wasting your time and file issue to https://github.com/develar/gh-routing-data/issues/new ;)
« Last Edit: June 26, 2018, 12:09:12 by develar »
 

Offline develar

  • More than Newbie
  • *
  • Posts: 12
  • Thanked: 6 times
    • View Profile
  • Device: Doogee S60
Re: Offline navigation - GraphHopper - preparation
« Reply #250 on: June 26, 2018, 12:12:35 »
About memory on mobile — Locus add-on correctly set MMAP instead of RAM_STORE. It works very fast because provided graphs by http://graphhopper.develar.org/ are sorted. Yes, there is penalty, but insignificant — you can build europe wide route (900 km) in _several seconds_. The only downside of large regions — disk space (e.g. de-at-ch takes 5GB). But SD cards are cheap nowadays :)
« Last Edit: June 26, 2018, 12:15:03 by develar »
 

Offline Bucky Kid

  • Padavan of Locus
  • ***
  • Posts: 296
  • Thanked: 5 times
    • View Profile
Re: Offline navigation - GraphHopper - preparation
« Reply #251 on: July 02, 2018, 06:36:21 »
Thanks for all the input. Combined region now compiles successfully. There remains one issue and that is when I use sorting (graph.do_sort), the compilation ends up with error

Code: [Select]
Exception in thread "main" java.lang.AssertionError: The turn cost storage must be initialized only once.
        at com.graphhopper.storage.TurnCostExtension.init(TurnCostExtension.java:60)
        at com.graphhopper.storage.BaseGraph.<init>(BaseGraph.java:144)
        at com.graphhopper.storage.GraphHopperStorage.<init>(GraphHopperStorage.java:83)
        at com.graphhopper.util.GHUtility.newStorage(GHUtility.java:281)
        at com.graphhopper.GraphHopper.postProcessing(GraphHopper.java:854)
        at com.graphhopper.GraphHopper.process(GraphHopper.java:671)
        at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:640)
        at com.graphhopper.tools.Import.main(Import.java:50)

If I turn off turncosts for calculation, the sorted data compile, so the two features probably cannot be used concurrently
 

Offline develar

  • More than Newbie
  • *
  • Posts: 12
  • Thanked: 6 times
    • View Profile
  • Device: Doogee S60
Re: Offline navigation - GraphHopper - preparation
« Reply #252 on: July 02, 2018, 08:23:50 »
You cannot use turn costs for now. https://github.com/graphhopper/graphhopper/issues/1401 I didn’t yet publish PR to Locus add-on.