graphhopper / graphhopper-ios

iOS Port of the GraphHopper road routing engine
https://www.graphhopper.com/open-source/
Apache License 2.0
69 stars 28 forks source link

Demo Crash #4

Closed dimohamdy closed 9 years ago

dimohamdy commented 9 years ago

There is exception when demo try to make route and this message apper "graphHopperLocation is not specified. call init before"

graphHopperFolder is nil please help me

clns commented 9 years ago

The "graphHopperLocation is not specified. call init before" error is in the GraphHopperTest.java#L397 file, which is part of the test suite and the iOS project doesn't call that.

dimohamdy commented 9 years ago

When i run the sample App in this method [_hopper load__WithNSString:location];

and the stack trace

clns commented 9 years ago

This looks like a graph data import issue. If you imported the data as described in the sample app, make sure you have all the Requirements, especially Maven. Check if the import succeeded by running ls -l graphhopper/graph-data.osm-gh/ in the repository root, which should show something like this:

$ ls -l graphhopper/graph-data.osm-gh/
total 204912
-rw-r--r--  1 calin  staff    50M Apr 20 20:57 edges
-rw-r--r--  1 calin  staff    26M Apr 20 20:57 geometry
-rw-r--r--  1 calin  staff    12M Apr 20 20:56 location_index
-rw-r--r--  1 calin  staff   2.0M Apr 20 20:57 names
-rw-r--r--  1 calin  staff    10M Apr 20 20:57 nodes
-rw-r--r--  1 calin  staff    32K Apr 20 20:57 properties

If you don't have this then most probably your import failed and you need to reimport the data.

If everything checks out, try running everything again, from scratch. Below is the sequence of commands I just ran successfully on my local machine. They are exactly like in the docs but I wrote them here for convenience. Watch out for any errors.

$ git clone --recursive https://github.com/graphhopper/graphhopper-ios.git
$ cd graphhopper-ios
$ ./graphhopper-ios-sample/import-sample.sh
$ curl -L -o j2objc-0.9.6.1.zip "https://github.com/google/j2objc/releases/download/0.9.6.1/j2objc-0.9.6.1.zip" && unzip j2objc-0.9.6.1.zip && mv j2objc-0.9.6.1 j2objc && rm j2objc-0.9.6.1.zip
$ open graphhopper-ios-sample/graphhopper-ios-sample.xcodeproj
# in Xcode, Build & Run on Simulator
dimohamdy commented 9 years ago

graph-data.osm-gh my file is graph-data.osm.pbf

clns commented 9 years ago

graph-data.osm.pbf is the raw data file from http://download.geofabrik.de/ and if you don't have the other files it means you didn't import the data into GraphHopper. Try running the import again using ./graphhopper-ios-sample/import-sample.sh and then check if the import succeeded as described above.

dimohamdy commented 9 years ago

i have graph-data.osm.pbf how i can make it as graph-data.osm-gh

clns commented 9 years ago

By running ./graphhopper-ios-sample/import-sample.sh.

dimohamdy commented 9 years ago

when i run it

Downloading http://download.geofabrik.de/europe/romania-latest.osm.pbf

clns commented 9 years ago

If the download starts it means you don't have it in the right place. However that's fine, after the download finishes the graph data will be created automatically and you can start playing with it in Xcode. There are instructions for importing Germany as well in the sample app.

dimohamdy commented 9 years ago

in xcode i will import romania-latest.osm.pbf file?

clns commented 9 years ago

Yes, by default the import script imports romania-latest.osm.pbf, so you can only create routes within Romania. This is just an example, you can follow the instructions on the sample app to import any country you want.

dimohamdy commented 9 years ago

i found the problem in marven ,did it take time when convert Thanks

dimohamdy commented 9 years ago

i still have problem but from marven Now

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] GraphHopper ........................................ FAILURE [03:54 min]
[INFO] GraphHopper Tools .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:36 min
[INFO] Finished at: 2015-04-21T22:59:56+02:00
[INFO] Final Memory: 15M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project graphhopper: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7, org.apache.maven:maven-error-diagnostics:jar:2.0.6: Could not transfer artifact org.apache.maven.doxia:doxia-sink-api:jar:1.0-alpha-7 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
clns commented 9 years ago

I'm not familiar with Maven, it is used by GraphHopper as its build system. Try google-ing the errors to see if you can find something useful. This popped up on a very quick search, not sure if it will be of any help.

As this error is not related to graphhopper-ios but core graphhopper maybe @karussell would know why Maven is complaining.

dimohamdy commented 9 years ago

thanks Again I try in it

karussell commented 9 years ago

It looks, like some HTTPS/host problems with maven central. Maybe you just try it again? If that does not help try what was suggested in @clns its link: rm -rf <home>/.m2/repository or even rm -rf <home>/.m2/

karussell commented 9 years ago

How was this fixed? @dimohamdy

dimohamdy commented 9 years ago

I install Maven that use to convert graph-data.osm.pbf to graph-data.osm-gh