作者:钟杰辉_576 | 来源:互联网 | 2023-09-08 16:16
本文整理了Java中com.graphhopper.GHResponse.getErrors()
方法的一些代码示例,展示了GHResponse.getErrors()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GHResponse.getErrors()
方法的具体详情如下:
包路径:com.graphhopper.GHResponse
类名称:GHResponse
方法名:getErrors
GHResponse.getErrors介绍
[英]This method returns all the explicitly added errors and the errors of all paths.
[中]此方法返回所有显式添加的错误和所有路径的错误。
代码示例
代码示例来源:origin: graphhopper/graphhopper
logger.error(logStr + ", errors:" + ghResponse.getErrors());
throw new MultiException(ghResponse.getErrors());
} else {
logger.info(logStr + ", alternatives: " + ghResponse.getAll().size()
代码示例来源:origin: graphhopper/graphhopper
failedCount.incrementAndGet();
if (rsp.getErrors().get(0).getMessage() == null)
rsp.getErrors().get(0).printStackTrace();
else if (!toLowerCase(rsp.getErrors().get(0).getMessage()).contains("not found"))
logger.error("errors should NOT happen in Measurement! " + req + " => " + rsp.getErrors());
代码示例来源:origin: cpesch/RouteConverter
public RoutingResult getRouteBetween(NavigationPosition from, NavigationPosition to, TravelMode travelMode) {
initializeHopper();
long start = currentTimeMillis();
try {
GHRequest request = new GHRequest(from.getLatitude(), from.getLongitude(), to.getLatitude(), to.getLongitude());
request.setVehicle(travelMode.getName().toUpperCase());
GHResponse respOnse= hopper.route(request);
if(response.hasErrors()) {
String errors = printArrayToDialogString(response.getErrors().toArray(), false);
log.severe(format("Error while routing between %s and %s: %s", from, to, errors));
throw new RuntimeException(errors);
}
PathWrapper best = response.getBest();
return new RoutingResult(asPositions(best.getPoints()), new DistanceAndTime(best.getDistance(), best.getTime() / 1000), true);
} finally {
long end = currentTimeMillis();
log.info("GraphHopper: routing from " + from + " to " + to + " took " + (end - start) + " milliseconds");
}
}