GraphHopper.com | Forum | GitHub | Maps | Blog

Load graph all the time


#1

i downloaded an osm map from www.openstreetmap.org, and converted it into -gh file by using ./graphhopper.sh command. the -gh file consists of edges(2M),geometry(1M), location_index(1M), names(1M),nodes, nodes_ch_fastest_car(1M), properties(32K), shortcuts_fastest_car(2M).
then i put the -gh file in the requested location, the app works but i didn’t get any information, it seems that the app loads graph all the time and won’t stop. my codes are as follows:

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.load(new File(mapsFolder, currentArea).getAbsolutePath() + “-gh”);
hopper = tmpHopp;
return null;
}

        protected void onPostExecute(Path o) {
            if (hasError()) {
                Toast.makeText(MainActivity.this,"error: " + getErrorMessage(),Toast.LENGTH_SHORT).show();
            } else {
                Toast.makeText(MainActivity.this,"Finished loading graph",Toast.LENGTH_SHORT).show();
            }
        }
    }.execute();
}

i really need help. thanks!