Graphhopper 0.13 new custom profile class

Dear community,
i want to implement a new profile class into gh 0.13 version for my study. i created a new class, i added it in the defaultflagencoderfactory and flagendcoderfactory but when i strart the app on my device, it automaticly uses the car profile. Any hints where can i change this or what i else have to do?

With best regards
Chamflo

Code Snippet:

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.setEncodingManager(EncodingManager.create(new CustomEncoder(4,2,0)));
//tmpHopp.setEncodingManager(EncodingManager.create(FlagEncoderFactory.CUSTOM));
//tmpHopp.setEncodingManager(new EncodingManager( “custom” ));
//EncodingManager encodingManager = EncodingManager.create(new CustomEncoder());
//tmpHopp.setEncodingManager(encodingManager);
tmpHopp.load(new File(mapsFolder, currentArea).getAbsolutePath() + “-gh”);
//tmpHopp.init(new CmdArgs().put(“graph.flag_encoders”, “custom”).put(Parameters.CH.PREPARE + “weightings”, “no”));
//tmpHopp.importOrLoad();
log("found graph " + tmpHopp.getGraphHopperStorage().toString() + “, nodes:” + tmpHopp.getGraphHopperStorage().getNodes());
hopper = tmpHopp;
return null;
}

        protected void onPostExecute(Path o) {
            if (hasError()) {
                logUser("An error happened while creating graph:"
                        + getErrorMessage());
            } else {
                logUser("Finished loading graph. Long press to define where to start and end the route.");
            }

            finishPrepare();
        }
    }.execute();
}

Update:
Where can i change the default profile to my custom profile or how do i change the code above to use my profile. The commented lines are different tries but every time another exception appears. For example “FlagEncoder not yet initialzed”, “FlagEncoder does not match” or “No configuration changes are possible after loading the graph”. If I should be more specific about anything just ask and i’ll try to answer properly.

Kind regards
Chamflo

Update:

Current Error Message:
An error happened while creating graph:Encoding does not match:
Graphhopper config: custom|speed_factor=2.0|speed_bits=4|turn_costs=false|version=2
Graph: car|speed_factor=5.0|speed_bits=5|turn_costs=false|version=2
Change configuration to match the graph or delete /storage/emulated/0/Download/graphhopper/maps/europe_germany_berlin-gh/

Deleting does not fix the problem!

Do i need to make changes in config.yml?
Still anything wrong in the code above?
And i still dont know where the profile car is defined as default profile… nowhere named as far as i read through the files

Kind regards
Chamflo

Powered by Discourse