Class ValhallaOfflineRoutingService

java.lang.Object
com.massifmaps.routing.RoutingService
com.massifmaps.routing.ValhallaOfflineRoutingService

public class ValhallaOfflineRoutingService extends RoutingService
An offline routing service that uses Valhalla routing tiles.
  • Constructor Details

    • ValhallaOfflineRoutingService

      public ValhallaOfflineRoutingService(String path) throws IOException
      Constructs a new ValhallaOfflineRoutingService instance given database file.
      Parameters:
      path - The full path to the database file.
      Throws:
      Exception - If the database file could not be opened or read.
      IOException
  • Method Details

    • getConfigurationParameter

      public Variant getConfigurationParameter(String param)
      Returns the value of specified Valhalla configuration parameter.
      Parameters:
      param - The name of the parameter. For example, "meili.auto.search_radius".
      Returns:
      The value of the parameter. If the parameter does not exist, empty variant is returned.
    • setConfigurationParameter

      public void setConfigurationParameter(String param, Variant value)
      Sets the value of specified Valhalla configuration parameter.
      Parameters:
      param - The name of the parameter. For example, "meili.auto.search_radius".
      value - The new value of the parameter.
    • getProfile

      public String getProfile()
      Description copied from class: RoutingService
      Returns the current routing profile.
      Overrides:
      getProfile in class RoutingService
      Returns:
      The current routing profile.
    • setProfile

      public void setProfile(String profile)
      Description copied from class: RoutingService
      Sets the current routing profile.
      Overrides:
      setProfile in class RoutingService
      Parameters:
      profile - The new routing profile. Routing profiles are dependent on specific routing service.
    • matchRoute

      public RouteMatchingResult matchRoute(RouteMatchingRequest request) throws IOException
      Description copied from class: RoutingService
      Matches specified points to the points on the road network.
      Overrides:
      matchRoute in class RoutingService
      Parameters:
      request - The matching request defining points.
      Returns:
      The matching result or null if route matching failed.
      Throws:
      IOException
    • calculateRoute

      public RoutingResult calculateRoute(RoutingRequest request) throws IOException
      Description copied from class: RoutingService
      Calculates routing result (path) based on routing request.
      Overrides:
      calculateRoute in class RoutingService
      Parameters:
      request - The routing request defining via points.
      Returns:
      The result or null if routing failed.
      Throws:
      IOException
    • addLocale

      public void addLocale(String key, String json)