Hi ,
Now , I'm Trying to use CarFlagEncoder in the grapphhope Demo ,
I modified the function LoadGraphStorage as this:
void loadGraphStorage()
{
logUser("Loading Graph(" + Constants.VERSION + ") ... ");
new GHAsyncTask<Void, Void, Path>()
{
protected Path saveDoInBackground( Void... v ) throws Exception
{
/* J' ai ajouté .setEncodingManager(new
EncodingManager("car"))*/
CarFlagEncoder car = new CarFlagEncoder(5,5,0){
@Override
public void applyWayTags(OSMWay way, EdgeIteratorState
edge) {
long[] ghEdgeIdToOSMWayIdMap = new long[1000];
ghEdgeIdToOSMWayIdMap[edge.getEdge()] = way.getId();
super.applyWayTags(way, edge);
}
};
GraphHopper tmpHopp = new
GraphHopper().setEncodingManager(new EncodingManager(car)).forMobile();
tmpHopp.load(new File(mapsFolder,
currentArea).getAbsolutePath());
log("graph found " + tmpHopp.getGraph().toString() + ",
nodes:" + tmpHopp.getGraph().getNodes());
hopper = tmpHopp;
return null;
}
Is it Correct ?
Or, How make to Use CarFlagEncoder?
Please,
Thank you
Fred Laurent,
_______________________________________________
GraphHopper mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/graphhopper