[GraphHopper] [Graphhopper] Routing
Fred Laurent
fredlaurent31 at gmail.com
Wed May 6 12:09:16 UTC 2015
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,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150506/023ebe70/attachment.html>
More information about the GraphHopper
mailing list