Package com.cercalia.sdk.model.routing
Class RouteResult
java.lang.Object
com.cercalia.sdk.model.routing.RouteResult
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for constructingRouteResultinstances. -
Method Summary
Modifier and TypeMethodDescriptionstatic RouteResult.Builderbuilder()Creates a new builder for constructingRouteResultinstances.@Nullable String@NotNull Coordinatedoubledouble@NotNull Coordinate@Nullable Double@Nullable List<Coordinate>@NotNull StringgetWkt()
-
Method Details
-
builder
Creates a new builder for constructingRouteResultinstances.- Returns:
- a new Builder instance
-
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
- Returns:
- The starting point of the route.
-
getDestination
- Returns:
- The destination point of the route.
-
getWaypoints
- Returns:
- The intermediate waypoints of the route.
-
getTollCost
- Returns:
- The estimated toll cost for the route, or
nullif not applicable.
-
getCurrency
- Returns:
- The currency code (ISO 4217) for the toll cost, or
nullif not applicable.
-