Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No CAR_RENTAL with allowKeepingAtDestination #5980

Open
hbruch opened this issue Jul 21, 2024 · 1 comment
Open

No CAR_RENTAL with allowKeepingAtDestination #5980

hbruch opened this issue Jul 21, 2024 · 1 comment
Labels
Stale This issue is stale, no activity for 90 days. Remove stale label or comment within 30 days.

Comments

@hbruch
Copy link
Contributor

hbruch commented Jul 21, 2024

Expected behavior

When searching a CAR_RENTAL journey for a feed with allowKeepingRentedVehicleAtDestination/allowKeepingAtDestination enabled, OTP should return a WALK/CAR journey, given there is a vehicleRentalStation with cars available at the origin.

Observed behavior

OTP only returns a WALK suggestion.

Version of OTP used (exact commit hash or JAR name)

9554487

Data sets in use (links to GTFS and OSM PBF files)

http://download.geofabrik.de/europe/germany/brandenburg-latest.osm.pbf
https://data.mfdz.de/gbfs/zegg_badbelzig/gbfs.json

Router config and graph build config JSON

router-config.json:

{
  "routingDefaults": {
     "car": {
      "rental": {
        "useAvailabilityInformation": false,
        "allowKeepingAtDestination": true
      }
    }
  },
  "updaters": [
    {
      "type": "vehicle-rental",
      "sourceType": "gbfs",
      "frequency": "15m",
      "allowKeepingRentedVehicleAtDestination": true,
      "url": "https://data.mfdz.de/gbfs/zegg_badbelzig/gbfs.json"
    }
  ]
}

Steps to reproduce the problem

CAR_RENTAL-Request

Analysis

Performing the same query with CAR mode returns a response with a single CAR leg.

To me, it looks like the issue is that for CAR_RENTAL, StreetIndex.getTraverseModeForLinker returns WALK as nonTransitMode for the endVertex, which prevents reaching the final toVertex with a rented car.

I suggest to change StreetIndex.getTraverseModeForLinker as follows, though I'm not sure if this would then prevent returning the car at a station close to the destination...

private TraverseMode getTraverseModeForLinker(StreetMode streetMode, boolean endVertex) {
    TraverseMode nonTransitMode = TraverseMode.WALK;
    // for park and ride we will start in car mode and walk to the end vertex
    boolean parkAndRideDepart = streetMode == StreetMode.CAR_TO_PARK && !endVertex;
    // for car rental, we want to allow keeping the car at destination
    boolean carRentalArrival = streetMode == StreetMode.CAR_RENTAL && endVertex;
    boolean onlyCarAvailable = streetMode == StreetMode.CAR;
    if (onlyCarAvailable || parkAndRideDepart || carRentalArrival) {
      nonTransitMode = TraverseMode.CAR;
    }
    return nonTransitMode;
  }

EDIT:
This issue seem to occur in the special case that the edge closest to the destination is a walk/bike only edge, as it is the case for destination https://www.openstreetmap.org/node/4819679118 :

grafik
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days

@github-actions github-actions bot added the Stale This issue is stale, no activity for 90 days. Remove stale label or comment within 30 days. label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale This issue is stale, no activity for 90 days. Remove stale label or comment within 30 days.
Projects
None yet
Development

No branches or pull requests

1 participant