//Optimize previously loaded database
GlobalGraphOperations graphOperations = GlobalGraphOperations.at(db);
System.out.printf("BEFORE OPTIMIZE nodes = %d ways = %d \n", nodesCount(graphOperations), relCount(graphOperations));
new OsmRoutingOptimizer(db).optimize();
System.out.printf("AFTER OPTIMIZE nodes = %d ways = %d \n", nodesCount(graphOperations), relCount(graphOperations));
//Find route
List<LineString> route = new RouteCalculator().findRoute(getStartNode(db), getEndNode(db));