AnyLogic
Expand
Font size
All Known Implementing Classes:
AbstractGISRouteFinder, AnyLogicOnlineRouteFinder, BRouterOSMRouteFinder, CachedGISRouteFinder, ChainedGISRouteFinder, GeneralizingGISRouteFinder, GISStraightRouteFinder, GraphHopperRouteFinder, ServerCaringGISRouteFinder, StrangeRouteGuard, YoursOSMRouteFinder

@AnyLogicInternalAPI
public interface IGISRouteFinder
This class is internal and shouldn't be called by user.
it may be removed/renamed in future.
Author:
AnyLogic North America, LLC https://anylogic.com

Method Summary

Modifier and TypeMethodDescription
GISResultDoublegetDistance(double[] latLonPoints)
Returns the distance by route with intermediate points.
GISResult<double[]>getRoute(double[] latLonPoints)
Returns the route build with the given input coordinates.
The result may depend on internal state of this route finder (e.g.
voidregisterDistanceCache(BiConsumer<double[],GISResultDouble> distanceCachePut) 

Method Details

getRoute

GISResult<double[]> getRoute(double[] latLonPoints)
Returns the route build with the given input coordinates.
The result may depend on internal state of this route finder (e.g. GeneralizingGISRouteFinder performs generalization with some configurable precision).
The format of result may also depend on the implementation.
  • raw (not generalized) routes are returned in the form of array of (lat, lon) pairs of resulting route curve, followed by a single number - the length of total route measured in meters.
     lat0 lon0 lat1 lon1 lat2 lon2 total_length 
     
  • generalized routes are returned in the form of array comprising: N (lat, lon) pairs, followed by (N-1) segment lengths, then one number - the length of the route. So that the resulting array length will be triple of the number of points. Given the r result of this method call, the first route segment would start at r[0], r[1], end at r[2], r[3] and will have 'real distance' length of r[r.length / 3 * 2 + 0] meters.
     lat0 lon0 lat1 lon1 lat2 lon2 seg01_len seg12_len total_length 
     
The total length of the route (measured in meters) is always stored in the last element of the returned array. Array length can't make any clue on whether this array contains generalized data or not - this understanding comes from the way the route finder chain was created.
Parameters:
latLonPoints - the array of coordinates ([latitude1, longitude1, latitude2, longitude2, ... latitudeN, longitudeN])
Returns:
see above, or empty optional if route not found, or null in case of server error

getDistance

GISResultDouble getDistance(double[] latLonPoints)
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

registerDistanceCache

void registerDistanceCache(BiConsumer<double[],GISResultDouble> distanceCachePut)