Package com.anylogic.engine.gis
- java.lang.Object
- com.anylogic.engine.gis.ChainedGISRouteFinder
- com.anylogic.engine.gis.GeneralizingGISRouteFinder
- Record Components:
latLonPoints
- (lat, lon) pairs representing, the start, then optional intermediate, and the end points.
- All Implemented Interfaces:
IGISRouteFinder
@AnyLogicInternalAPI public class GeneralizingGISRouteFinder extends ChainedGISRouteFinder
This class is internal and shouldn't be called by user.
it may be removed/renamed in future.
Returns generalized curve obtained from route provider. Note the different format of returned result. This method also calculates the real length of curve segments using the data from the route provider.
it may be removed/renamed in future.
Returns generalized curve obtained from route provider. Note the different format of returned result. This method also calculates the real length of curve segments using the data from the route provider.
- Author:
- AnyLogic North America, LLC https://anylogic.com
Constructor | Description |
---|---|
GeneralizingGISRouteFinder |
Modifier and Type | Method | Description |
---|---|---|
GISResultDouble | getDistance |
Returns the distance by route with intermediate points.
|
int | getPrecisionInMeters() | |
GISResult<double[]> | getRoute |
Returns the route build with the given input coordinates.
The result may depend on internal state of this route finder (e.g. |
public GeneralizingGISRouteFinder(IGISRouteFinder base, int precisionInMeters)
public int getPrecisionInMeters()
public GISResult<double[]> getRoute(double[] latLonPoints)
Description copied from interface:
IGISRouteFinder
Returns the route build with the given input coordinates.
The result may depend on internal state of this route finder (e.g.
The format of result may also depend on the implementation.
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 atr[0], r[1]
, end atr[2], r[3]
and will have 'real distance' length ofr[r.length / 3 * 2 + 0]
meters.lat0 lon0 lat1 lon1 lat2 lon2 seg01_len seg12_len total_length
- 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
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