AnyLogic
Expand
Font size
All Implemented Interfaces:
IGISRouteFinder

@AnyLogicInternalAPI
public class GraphHopperRouteFinder
extends AbstractGISRouteFinder
This class is internal and shouldn't be called by user.
it may be removed/renamed in future.
Provider of routes www.graphhopper.com. It requires file based routing graph and works without internet connection.
Author:
AnyLogic North America, LLC https://anylogic.com

Field Summary

Modifier and TypeFieldDescription
static String[]GRAPH_HOPPER_ROUTING_FILES 

Constructor Summary

ConstructorDescription
GraphHopperRouteFinder(String graphFilesPath, String pathFindingAlgorithm, RoutingMethod routingMethod, int precisionInMeters) 

Method Summary

Modifier and TypeMethodDescription
voidclose()
Call com.graphhopper.GraphHopper.close() to release files.
static com.graphhopper.GraphHoppercreateGraphhopperInstance() 
static booleanfolderContainsGraphHopperRoutingGraph(String folder) 
GISResultDoublegetDistance(double[] latLonPoints)
Returns the distance by route with intermediate points.
StringgetGraphFilesPath() 
StringgetPathFindingAlgorithm() 
intgetPrecisionInMeters() 
GISResult<double[]>getRoute(double[] latLonPoints)
Returns curve obtained "as is" from route provider, without generalization
RoutingMethodgetRoutingMethod() 
voidsetPathFindingAlgorithm(String pathFindingAlgorithm) 
voidsetPrecisionInMeters(int precisionInMeters) 
voidsetRoutingMethod(RoutingMethod routingMethod) 

Methods inherited from class com.anylogic.engine.gis.AbstractGISRouteFinder

registerDistanceCache

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

GRAPH_HOPPER_ROUTING_FILES

public static String[] GRAPH_HOPPER_ROUTING_FILES

Constructor Details

GraphHopperRouteFinder

public GraphHopperRouteFinder(String graphFilesPath,
 String pathFindingAlgorithm,
 RoutingMethod routingMethod,
 int precisionInMeters)

Method Details

folderContainsGraphHopperRoutingGraph

public static boolean folderContainsGraphHopperRoutingGraph(String folder)

getDistance

public GISResultDouble getDistance(double[] latLonPoints)
Description copied from interface: IGISRouteFinder
Returns the distance by route with intermediate points.
Parameters:
latLonPoints - the array of coordinates ([latitude1, longitude1, latitude2, longitude2, ... latitudeN, longitudeN])
Returns:
the distance of route which sequentially connects all specified points, empty optional if route not found, or null in case of server error

createGraphhopperInstance

@AnyLogicInternalAPI
public static com.graphhopper.GraphHopper createGraphhopperInstance()

getGraphFilesPath

@AnyLogicInternalAPI
public String getGraphFilesPath()

getRoutingMethod

@AnyLogicInternalAPI
public RoutingMethod getRoutingMethod()

setRoutingMethod

@AnyLogicInternalAPI
public void setRoutingMethod(RoutingMethod routingMethod)

getPathFindingAlgorithm

@AnyLogicInternalAPI
public String getPathFindingAlgorithm()

setPathFindingAlgorithm

@AnyLogicInternalAPI
public void setPathFindingAlgorithm(String pathFindingAlgorithm)

getPrecisionInMeters

@AnyLogicInternalAPI
public int getPrecisionInMeters()

setPrecisionInMeters

@AnyLogicInternalAPI
public void setPrecisionInMeters(int precisionInMeters)

close

@AnyLogicInternalAPI
public void close()
Call com.graphhopper.GraphHopper.close() to release files.

getRoute

public GISResult<double[]> getRoute(double[] latLonPoints)
Description copied from class: AbstractGISRouteFinder
Returns curve obtained "as is" from route provider, without generalization
Specified by:
getRoute in interface IGISRouteFinder
Specified by:
getRoute in class AbstractGISRouteFinder
Parameters:
latLonPoints - (lat, lon) pairs representing, the start, then optional intermediate, and the end points. Returns array of (lat, lon) pairs of resulting route curve, after all the points there is a number with the total distance.
Returns:
see above, or empty optional if route not found, or null in case of server error