Class RouteResult

java.lang.Object
com.cercalia.sdk.model.routing.RouteResult

public final class RouteResult extends Object
Route calculation result from Cercalia API.

Contains route geometry, statistics, and metadata for a calculated route between two or more points. Includes information such as:

  • Distance and duration
  • Route geometry in WKT format
  • Waypoints (intermediate stops)
  • Toll costs (if applicable)

 RoutingService service = new RoutingService(config);
 RouteResult route = service.route(RoutingOptions.builder()
     .origin(new Coordinate(41.3851, 2.1734))
     .destination(new Coordinate(41.3954, 2.1576))
     .vehicle(VehicleType.CAR)
     .build());

 System.out.println("Distance: " + route.getDistance() + " meters");
 System.out.println("Duration: " + (route.getDuration() / 60) + " minutes");
 
See Also:
  • Method Details

    • builder

      public static RouteResult.Builder builder()
      Creates a new builder for constructing RouteResult instances.
      Returns:
      a new Builder instance
    • getWkt

      @NotNull public @NotNull String getWkt()
      Returns:
      The route geometry in Well-Known Text (WKT) format.
    • getDistance

      public double getDistance()
      Returns:
      The total distance of the route in meters.
    • getDuration

      public double getDuration()
      Returns:
      The estimated travel time for the route in seconds.
    • getOrigin

      @NotNull public @NotNull Coordinate getOrigin()
      Returns:
      The starting point of the route.
    • getDestination

      @NotNull public @NotNull Coordinate getDestination()
      Returns:
      The destination point of the route.
    • getWaypoints

      @Nullable public @Nullable List<Coordinate> getWaypoints()
      Returns:
      The intermediate waypoints of the route.
    • getTollCost

      @Nullable public @Nullable Double getTollCost()
      Returns:
      The estimated toll cost for the route, or null if not applicable.
    • getCurrency

      @Nullable public @Nullable String getCurrency()
      Returns:
      The currency code (ISO 4217) for the toll cost, or null if not applicable.