Skip to content

Update run.sh script (UI never appears, or appears but no routes are drawn) #4

Closed

Description

@agouge

Hello, I'm trying to follow the instructions on the Usage page of your wiki.

If I try

./run.sh unterfranken.osm

or

./run.sh germany.osm

the script pauses at the following output:

using java 1.7.0_09 from 
No OSM file found or specified. Grabbing it from internet. Press CTRL+C if you do not have enough disc space or you don't want to download several MB

I press enter, and the file seems to be saved:

2012-12-04 15:19:30 (124 MB/s) - `unterfranken.osm.bz2' saved [4505/4505]

But I then encounter some exceptions:

Exception in thread "main" java.lang.IllegalStateException: Your specified OSM file does not exist:unterfranken.osm

and

Exception in thread "main" java.lang.IllegalArgumentException: Graph not found and no OSM xml provided.

See the full output below.*

If I try running the script on an osm I download from the internet, the graph is built just fine. But if I rerun the script, the tests are performed, but the UI never pops up. I would love to see the UI!

Thanks!

*Output:

$ ./run.sh unterfranken.osm
using java 1.7.0_09 from 
No OSM file found or specified. Grabbing it from internet. Press CTRL+C if you do not have enough disc space or you don't want to download several MB

rm: cannot remove `unterfranken.osm.bz2': No such file or directory
## now downloading OSM file from http://download.geofabrik.de/osm/europe/germany/bayern/unterfranken.osm.bz2
--2012-12-04 15:19:30--  http://download.geofabrik.de/osm/europe/germany/bayern/unterfranken.osm.bz2
Resolving download.geofabrik.de (download.geofabrik.de)... 46.4.99.10
Connecting to download.geofabrik.de (download.geofabrik.de)|46.4.99.10|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://download.geofabrik.de/ [following]
--2012-12-04 15:19:30--  http://download.geofabrik.de/
Reusing existing connection to download.geofabrik.de:80.
HTTP request sent, awaiting response... 200 OK
Length: 4505 (4,4K) [text/html]
Saving to: `unterfranken.osm.bz2'

100%[========================================================================================>] 4 505       --.-K/s   in 0s      

2012-12-04 15:19:30 (124 MB/s) - `unterfranken.osm.bz2' saved [4505/4505]

## extracting unterfranken.osm.bz2
bzip2: unterfranken.osm.bz2 is not a bzip2 file.
## existing jar found target/graphhopper-0.1-SNAPSHOT-jar-with-dependencies.jar
## now creating graph unterfranken-gh (folder) from unterfranken.osm (file),  JAVA_OPTS=-XX:PermSize=20m -XX:MaxPermSize=20m -Xmx500m -Xms500m
## HINT: put the osm on an external device to speed up import time
2012-12-04 15:19:31,098 [main] INFO  com.graphhopper.reader.OSMReader - using GraphStorage|RAMDirectory|1, memory:totalMB:479, usedMB:5
Exception in thread "main" java.lang.IllegalStateException: Your specified OSM file does not exist:unterfranken.osm
    at com.graphhopper.reader.OSMReader.osm2Graph(OSMReader.java:170)
    at com.graphhopper.reader.OSMReader.osm2Graph(OSMReader.java:144)
    at com.graphhopper.reader.OSMReader.main(OSMReader.java:70)
## now running com.graphhopper.reader.OSMReader. java opts=-XX:PermSize=20m -XX:MaxPermSize=20m -Xmx500m -Xms500m
2012-12-04 15:19:31,346 [main] INFO  com.graphhopper.reader.OSMReader - using GraphStorage|RAMDirectory|1, memory:totalMB:479, usedMB:5
Exception in thread "main" java.lang.IllegalArgumentException: Graph not found and no OSM xml provided.
    at com.graphhopper.reader.OSMReader.osm2Graph(OSMReader.java:166)
    at com.graphhopper.reader.OSMReader.osm2Graph(OSMReader.java:144)
    at com.graphhopper.reader.OSMReader.main(OSMReader.java:70)

Activity

  1. agouge commented on Dec 4, 2012

    @agouge
    Author

    I uncommented a line in the script and was able to launch the UI, but it was blank except for the three lines in blue. No routes are drawn.

    My changes to the script: From:

    14 if [ "x$CLASS" = "x" ]; then 
    15 # CLASS=com.graphhopper.ui.MiniGraphUI
    16  CLASS=com.graphhopper.reader.OSMReader
    17 fi
    

    To:

    14 if [ "x$CLASS" = "x" ]; then 
    15  CLASS=com.graphhopper.ui.MiniGraphUI
    16 # CLASS=com.graphhopper.reader.OSMReader
    17 fi
    

    Output:

    $ ./run.sh reunion.osm
    using java 1.7.0_09 from 
    ## using existing osm file reunion.osm
    ## existing jar found target/graphhopper-0.1-SNAPSHOT-jar-with-dependencies.jar
    ## using existing graph at reunion-gh
    ## now running com.graphhopper.ui.MiniGraphUI. java opts=-XX:PermSize=20m -XX:MaxPermSize=20m -Xmx1000m -Xms1000m
    2012-12-04 15:39:55,716 [main] INFO  com.graphhopper.reader.OSMReader - using GraphStorage|RAMDirectory|1, memory:totalMB:958, usedMB:5
    2012-12-04 15:39:55,811 [main] INFO  com.graphhopper.reader.OSMReader - graph edges:225015(8), nodes:217577(8), bounds:55.21715518572528,55.83389284090458,-21.38761124881233,0.0
    2012-12-04 15:39:55,811 [main] INFO  com.graphhopper.ui.MiniGraphUI - locations:217577, debug:false
    mainResized:1200 700
    path 76843->76843
    nothing found 5
    mainResized:1208 701
    path 76843->76843
    nothing found 5
    
  2. karussell commented on Dec 4, 2012

    @karussell
    Member

    the problem is that geofabrik changed their URLs ... I'll fix in a minute

  3. added a commit that references this issue on Dec 4, 2012
  4. karussell commented on Dec 4, 2012

    @karussell
    Member

    be sure you remove the empty unterfranken-gh folder before you pull and retry

  5. agouge commented on Dec 4, 2012

    @agouge
    Author

    After installing curl, I was able to run the script for unterfranken. (The wiki should probably specify that curl is required.)

    However, I think you should update your wiki to specify that you have to uncomment the following commented line in order to launch the UI (the tests are re-run if you just run the same command):

    14 if [ "x$CLASS" = "x" ]; then 
    15 # CLASS=com.graphhopper.ui.MiniGraphUI
    16  CLASS=com.graphhopper.reader.OSMReader
    17 fi
    

    Unfortunately, the UI is still completely white aside from the three lines in blue. No routes are drawn.

    Thanks for your help!

  6. karussell commented on Dec 4, 2012

    @karussell
    Member

    Oh, I moved the wget call to curl to make it working on iOS will think about a better fix.

    if the UI stays empty => what do you see in the logs? is a proper graph with some nodes loaded?

    try zooming out via mouse wheel as the mini UI still has sometimes problems with the correct bounding box. btw: better use the graphhopper-web project to get better maps and not only roads. the included mini ui is only intented for debugging purposes.

  7. karussell commented on Dec 4, 2012

    @karussell
    Member

    btw: if you like tweaking bash scripts I would really like to get a better run.sh and would like to accept pull requests ... some default configs are fetched from the config.properties file (e.g. to disable test run etc)

  8. agouge commented on Dec 4, 2012

    @agouge
    Author

    Zooming out did the trick!
    I'll check out graphhopper-web.

    I'll keep you updated if I find some improvements in run.sh.

    Thanks for your help!

  9. added a commit that references this issue on Dec 4, 2012
  10. karussell commented on Dec 4, 2012

    @karussell
    Member

    let me know if you still have trouble with something. should be all fixed now (see my commit message). now one needs to execute the script via "./run.sh unterfranken.osm ui"

  11. added a commit that references this issue on May 15, 2015
  12. added a commit that references this issue on Jun 23, 2020
  13. added a commit that references this issue on Jul 10, 2020
  14. added a commit that references this issue on Jun 10, 2022
  15. added a commit that references this issue on Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions