Closed dimohamdy closed 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.
When i run the sample App in this method [_hopper load__WithNSString:location];
and the stack trace
objc_exception_throw, name = 'main', queue = 'com.apple.root.default-qos', stop reason = breakpoint 1.1 frame #0: 0x017aca6b libobjc.A.dylib
objc_exception_throw
-[GraphHopper load__WithNSString:](self=0x7f8570d0, _cmd=0x005eea2e, graphHopperFolder=0x00000000) + 151 at GraphHopper.m:528 frame #2: 0x000d5be7 graphhopper-ios-sample
-[Directions hopper](self=0x7a7e8e40, _cmd=0x005eea8b) + 599 at Directions.m:85
frame #3: 0x000d638d graphhopper-ios-sample__19-[Directions route]_block_invoke(.block_descriptor=<unavailable>) + 829 at Directions.m:109 frame #4: 0x032f230a libdispatch.dylib
_dispatch_call_block_and_release + 15
frame #5: 0x03312e2f libdispatch.dylib_dispatch_client_callout + 14 frame #6: 0x032fb10f libdispatch.dylib
_dispatch_root_queue_drain + 634
frame #7: 0x032fc84a libdispatch.dylib_dispatch_worker_thread3 + 115 frame #8: 0x0366e1da libsystem_pthread.dylib
_pthread_wqthread + 724
frame #9: 0x0366be2e libsystem_pthread.dylib`start_wqthread + 30This 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
graph-data.osm-gh my file is graph-data.osm.pbf
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.
i have graph-data.osm.pbf how i can make it as graph-data.osm-gh
By running ./graphhopper-ios-sample/import-sample.sh
.
when i run it
Downloading http://download.geofabrik.de/europe/romania-latest.osm.pbf
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.
in xcode i will import romania-latest.osm.pbf file?
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.
i found the problem in marven ,did it take time when convert Thanks
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
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.
thanks Again I try in it
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/
How was this fixed? @dimohamdy
I install Maven that use to convert graph-data.osm.pbf to graph-data.osm-gh
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