java.lang.Object | ||
↳ | com.carto.routing.RoutingService | |
↳ | com.carto.routing.SGREOfflineRoutingService |
An offline routing service that uses SGRE routing engine.
Note: this class is experimental and may change or even be removed in future SDK versions.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SGREOfflineRoutingService(Variant geoJSON, Variant config)
Constructs a new SGREOfflineRoutingService instance from a given GeoJSON and rule list.
| |||||||||||
SGREOfflineRoutingService(Projection projection, FeatureCollection featureCollection, Variant config)
Constructs a new SGREOfflineRoutingService instance from a given feature collection and rule list.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RoutingResult |
calculateRoute(RoutingRequest request)
Calculates routing result (path) based on routing request.
| ||||||||||
synchronized void | delete() | ||||||||||
String |
getProfile()
Returns the current routing profile.
| ||||||||||
float |
getRoutingParameter(String param)
Returns the value of specified routing parameter.
| ||||||||||
RouteMatchingResult |
matchRoute(RouteMatchingRequest request)
Matches specified points to the points on the road network.
| ||||||||||
void |
setProfile(String profile)
Sets the current routing profile.
| ||||||||||
void |
setRoutingParameter(String param, float value)
Sets the value of specified routing parameter.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructs a new SGREOfflineRoutingService instance from a given GeoJSON and rule list.
geoJSON | The GeoJSON variant specifying features used for the routing graph. |
---|---|
config | A configuration specifying various routing metrics and rules. |
Exception | If an error occured during rule list parsing. |
---|---|
IOException |
Constructs a new SGREOfflineRoutingService instance from a given feature collection and rule list.
projection | Projection for the features in featureCollection. Can be null if the coordinates are based on WGS84. |
---|---|
featureCollection | The feature collection used for the routing graph. |
config | A configuration specifying various routing metrics and rules. |
Exception | If an error occured during rule list parsing. |
---|---|
IOException |
Calculates routing result (path) based on routing request.
request | The routing request defining via points. |
---|
IOException |
---|
Returns the current routing profile.
Returns the value of specified routing parameter.
param | The name of the parameter. For example "$speed". |
---|
Matches specified points to the points on the road network.
request | The matching request defining points. |
---|
IOException |
---|
Sets the current routing profile.
profile | The new routing profile. Routing profiles are dependent on specific routing service. |
---|
Sets the value of specified routing parameter.
param | The name of the parameter. For example "$speed". |
---|---|
value | The new value of the parameter. |