[GraphHopper] Call load error

Daniele Germano danielegermano77 at gmail.com
Mon Sep 1 09:44:47 UTC 2014


Hello

I Have created graphhopper files of paris from paris.osm. then i put paris.map in the paris-gh folder and put the folder in the graphhopper/maps folder.
When i start the app, it load map and graphs. but it crash when i try to create route. For what i see SavedDoInBackGround is for download files, which is not my case because i already have the files.

Il giorno 01/set/2014, alle ore 11:26, Peter <graphhopper at gmx.de> ha scritto:

> Hi Daniele,
> 
> hmmh, sounds more like a bug with some special circumstances with your device. Maybe it cannot access some files or disc was full etc?
> 
> Would you check in saveDoInBackground what the result of
> new File(mapsFolder, currentArea).getAbsolutePath()
> is and what
> tmpHopp.load(new File(mapsFolder, currentArea).getAbsolutePath());
> returns?
> 
> Regards,
> Peter.
> 
> On 01.09.2014 11:13, Daniele Germano wrote:
>> Hello
>>  I’am try to use graphhoper but i’m stuck with this problem:
>> 
>> if i try to run the Sample or the apk (0.3), it crash. The crash happen when end route flag (red) is on the map. this is the Logcat:
>> 
>> 09-01 11:10:02.051: E/AndroidRuntime(10946): FATAL EXCEPTION: AsyncTask #3
>> 09-01 11:10:02.051: E/AndroidRuntime(10946): java.lang.RuntimeException: An error occured while executing doInBackground()
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at android.os.AsyncTask$3.done(AsyncTask.java:299)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at java.util.concurrent.FutureTask.run(FutureTask.java:239)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at java.lang.Thread.run(Thread.java:856)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946): Caused by: java.lang.IllegalStateException: Call load or importOrLoad before routing
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at com.graphhopper.GraphHopper.route(GraphHopper.java:743)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at com.graphhopper.android.MainActivity$8.doInBackground(MainActivity.java:501)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at com.graphhopper.android.MainActivity$8.doInBackground(MainActivity.java:1)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
>> 09-01 11:10:02.051: E/AndroidRuntime(10946):  ... 4 more
>> 
>> But i see that load()  already exist in the project:
>> 
>> void loadGraphStorage()
>>     {
>>         logUser("loading graph (" + Constants.VERSION + ") ... ");
>>         new GHAsyncTask<Void, Void, Path>()
>>         {
>>             protected Path saveDoInBackground( Void... v ) throws Exception
>>             {
>>                 GraphHopper tmpHopp = new GraphHopper().forMobile();
>>                 tmpHopp.setCHShortcuts("fastest");
>>                 tmpHopp.load(new File(mapsFolder, currentArea).getAbsolutePath());
>>                 log("found graph " + tmpHopp.getGraph().toString() + ", nodes:" + tmpHopp.getGraph().getNodes());
>>                 hopper = tmpHopp;
>>                 return null;
>>             }
>> 
>>             protected void onPostExecute( Path o )
>>             {
>>                 if (hasError())
>>                 {
>>                     logUser("An error happend while creating graph:"
>>                             + getErrorMessage());
>>                 } else
>>                 {
>>                     logUser("Finished loading graph. Press long to define where to start and end the route.");
>>                 }
>> 
>>                 finishPrepare();
>>             }
>>         }.execute();
>>     }
>> 
>> How can i solve this problem?
>> 
>> Thank you
>> 
>> 
>> _______________________________________________
>> GraphHopper mailing list
>> GraphHopper at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/graphhopper
> 
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20140901/6f6f1f35/attachment.html>


More information about the GraphHopper mailing list