public final class DynamicGRAInstance extends Object implements IGRAInstance
IGRAInstance.
Dynamic Instance will load the changes in the configuration files (both properties and JSON files) on the next
request after the changes have been made. User don't have to restart the application for changes in configuration
files to take effect.
It is recommended you use IGRAInstanceFactory to get an instance of IGRAInstance.| Constructor and Description |
|---|
DynamicGRAInstance(File params)
Creates an instance of this class which can used to run routing operations.
|
public DynamicGRAInstance(File params) throws RoutingException
params - - properties file containing various properties required for routing engine.
various properties which can be present in properties file are:
routeDefaultCoordSys: Default Coordinate System for Routing operations provided in epsg format ex: epsg:4326. multiPointTimeout: Timeout in milliseconds for multi point request. isoTimeout: Timeout in milliseconds for Iso request. matrixRouteTimeOut: Timeout in milliseconds for matrix request. allowFallback: boolean, whether to fall back on major roads if no route is found using minor roads. routeTimeOut: Timeout in milliseconds for route request. shortProcessThreads: Number of threads which can be created for execution of route request. longProcessThreads: Number of threads which can be created for execution of iso, multipoint and matrix request.
RoutingException - If something goes wrong during initialization.public GetTravelBoundaryResponse getTravelBoundary(GetTravelBoundaryRequest request) throws RoutingException
IGRAInstanceGetTravelBoundaryResponse object corresponding to a GetTravelBoundaryRequest object.
In GetTravelBoundaryRequest class you can specify various options for Travel Boundary.
Request can either be IsoChrone or IsoDistance. If request is intended to be IsoChrone,
TimeUnit should be set to appropriate value and LinearUnit
should be set null.
If Request is intended to be IsoDistance, LinearUnit should be set to appropriate value
and TimeUnit should be null.
It is illegal to set both to non-null values.
getTravelBoundary in interface IGRAInstancerequest - GetTravelBoundaryRequest object for which travel boundary will be generated.GetTravelBoundaryResponse object which contains List of
TravelBoundary for the request.RoutingException - If something goes wrong while processing the request.public GetRouteResponse getRoute(GetRouteRequest request) throws RoutingException
IGRAInstanceGetRouteResponse object corresponding to a GetRouteRequest object.
In GetRouteRequest class you can specify various options for route calculation.
GetRouteRequest takes a starting location and an ending location with optional intermediate points as input,
and returns the route that is either the fastest or the shortest.
Specify distance unit (LinearUnit)
and TimeUnit to get the route response in desired units.
getRoute in interface IGRAInstancerequest - GetRouteRequest object for which route will be generated.GetRouteResponse object which contains the following:
ArrayList of RouteInstruction.IGeometry of the route.RoutingException - If something goes wrong while processing the request.public GetRouteCostMatrixResponse getRouteCostMatrix(GetRouteCostMatrixRequest request) throws RoutingException
IGRAInstanceGetRouteCostMatrixResponse object corresponding to a GetRouteCostMatrixRequest object.
In GetRouteCostMatrixRequest class you can specify various options for route calculation.
GetRouteCostMatrixRequest takes list of start locations and end locations as input, and returns the route cost matrix
that is either the fastest or the shortest.
Specify distance unit (LinearUnit)
and TimeUnit to get the route cost matrix response in desired units.
getRouteCostMatrix in interface IGRAInstancerequest - GetRouteCostMatrixRequest object for which route cost matrix will be generated.GetRouteCostMatrixResponse object which contains route cost matrix generated.
It also contains the time and distance to travel through for each route.RoutingException - If something goes wrong while processing the request.public GetSegmentDataResponse getSegmentData(GetSegmentDataRequest request) throws RoutingException
IGRAInstanceGetSegmentDataResponse object corresponding to a GetSegmentDataRequest object.
In GetSegmentDataRequest class you can specify various options for fetching segment information.
GetSegmentDataRequest takes either point or segment id for which segment information is to be fetched from network.
getSegmentData in interface IGRAInstancerequest - GetRouteCostMatrixRequest object for which segment data will be fetched.GetRouteCostMatrixResponse object which contains segment information for the specified segment.RoutingException - If something goes wrong while processing the request.public void destroy()
IGRAInstancedestroy in interface IGRAInstancepublic PersistentUpdateResponse createPersistentUpdates(PersistentUpdateRequest request) throws RoutingException
IGRAInstance
In PersistentUpdateRequest class you can specify List of Update to be applied on the network.
createPersistentUpdates in interface IGRAInstancerequest - PersistentUpdateRequest object containing List of Update to be
applied on the network.PersistentUpdateResponse object which contains the success message for PersistentUpdateRequest.RoutingException - If something goes wrong while processing the request.public PersistentResetResponse resetPersitentUpdates(PersistentResetRequest request) throws RoutingException
IGRAInstanceUpdate
applied on the network. To revert all the updates applied reset all option can be used.
In PersistentResetRequest class you can specify List of Reset to be applied on the network.
resetPersitentUpdates in interface IGRAInstancerequest - PersistentResetRequest object containing List of Reset to be
applied on the network or reset all option is set to true to revert all the Update applied
on the network.PersistentResetResponse object which contains the success message for PersistentResetRequest.RoutingException - If something goes wrong while processing the request.