Package com.massifmaps.routing
Class SGREOfflineRoutingService
java.lang.Object
com.massifmaps.routing.RoutingService
com.massifmaps.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.
Note: this class is experimental and may change or even be removed in future SDK versions.
-
Constructor Summary
ConstructorsConstructorDescriptionSGREOfflineRoutingService(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. -
Method Summary
Modifier and TypeMethodDescriptioncalculateRoute(RoutingRequest request) Calculates routing result (path) based on routing request.Returns the current routing profile.floatgetRoutingParameter(String param) Returns the value of specified routing parameter.matchRoute(RouteMatchingRequest request) Matches specified points to the points on the road network.voidsetProfile(String profile) Sets the current routing profile.voidsetRoutingParameter(String param, float value) Sets the value of specified routing parameter.
-
Constructor Details
-
SGREOfflineRoutingService
Constructs a new SGREOfflineRoutingService instance from a given GeoJSON and rule list.- Parameters:
geoJSON- The GeoJSON variant specifying features used for the routing graph.config- A configuration specifying various routing metrics and rules.- Throws:
Exception- If an error occured during rule list parsing.IOException
-
SGREOfflineRoutingService
public SGREOfflineRoutingService(Projection projection, FeatureCollection featureCollection, Variant config) throws IOException Constructs a new SGREOfflineRoutingService instance from a given feature collection and rule list.- Parameters:
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.- Throws:
Exception- If an error occured during rule list parsing.IOException
-
-
Method Details
-
getRoutingParameter
Returns the value of specified routing parameter.- Parameters:
param- The name of the parameter. For example "$speed".- Returns:
- The value of the parameter. If the parameter does not exist, NaN is returned.
-
setRoutingParameter
Sets the value of specified routing parameter.- Parameters:
param- The name of the parameter. For example "$speed".value- The new value of the parameter.
-
getProfile
Description copied from class:RoutingServiceReturns the current routing profile.- Overrides:
getProfilein classRoutingService- Returns:
- The current routing profile.
-
setProfile
Description copied from class:RoutingServiceSets the current routing profile.- Overrides:
setProfilein classRoutingService- Parameters:
profile- The new routing profile. Routing profiles are dependent on specific routing service.
-
matchRoute
Description copied from class:RoutingServiceMatches specified points to the points on the road network.- Overrides:
matchRoutein classRoutingService- Parameters:
request- The matching request defining points.- Returns:
- The matching result or null if route matching failed.
- Throws:
IOException
-
calculateRoute
Description copied from class:RoutingServiceCalculates routing result (path) based on routing request.- Overrides:
calculateRoutein classRoutingService- Parameters:
request- The routing request defining via points.- Returns:
- The result or null if routing failed.
- Throws:
IOException
-