GTFS-Flex 2.1 and OTP2

263 views
Skip to first unread message

Roberto Martinelli

unread,
Jul 27, 2021, 11:23:15 AM7/27/21
to OpenTripPlanner Users
Hello everybody,
I'm a GTFS-Flex newbie and I'm try to figure out how to make the Flex examples in https://github.com/MobilityData/gtfs-flex work with OTP2.
The only build-config.json information I've found (http://docs.opentripplanner.org/en/v1.5.0/Flex/ ) is related to OTP1.5 and apparently doesn't work with OTP2.
I tried to build the graph using:
  • otp-2.0.0-20191023.121912-2-shaded.jar 
  • otp-2.0.0-rc1-shaded.jar
  • otp-2.0.0-shaded.jar
  • otp-2.1.0-SNAPSHOT-shaded.jar (HSL)
Any suggestions/help would be appreciated
Roberto

Leonard Ehrenfried

unread,
Jul 27, 2021, 12:30:02 PM7/27/21
to opentrippl...@googlegroups.com
Hi Roberto,

GTFS Flex is a very new feature so you need to download the very newest jar build by CI from GitHub packages (actually not easy to find) or compile it yourself.

Also, you need to add another file called otp-config.json and add a setting like this: https://github.com/stadtnavi/digitransit-ansible/blob/master/roles/digitransit/templates/otp/otp-config.json#L5

All the best
--
  Leonard Ehrenfried
--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.

Roberto Martinelli

unread,
Jul 28, 2021, 1:06:21 PM7/28/21
to OpenTripPlanner Users
Thank you very much Leonard,
I took your advice and modified the otp-config.json accordingly.
BTW we currently use the 2.1.0-SNAPSHOT-shaded.jar by HSL (we use Digitransit as a front-end).
I'm just studying the Flexible Services/On-demand Services domain and the practical applications in both GTFS-Flex and NeTEx, using OTP2 as is (no Digitransit).

Now my config files ar like this:

BUILD-CONFIG

{

  "storage": {

    "osm": ["file:///app/osm-utilities/osm-data/yourfile.osm.pbf"],

    "localFileNamePatterns": {

      "gtfs": "^something.*\\.zip$"

    }

  },

  "transit": true,

  "streets": true, 

  "extraEdgesStopPlatformLink": false,

  "useTransfersTxt": true,

  }

OTP-CONFIG

// otp-config.json

{

    otpFeatures : {

        APIBikeRental : false,

        SandboxAPILegacyGraphQLApi : true,

        FlexRouting: true  

    }

}

ROUTER-CONFIG

{

  routingDefaults: {

        driveOnRight: false

       },

   "requestLogFile": "/app/otpnew/graphs/cripplecreek-200-GTFSFLEX/request.log",

  "useFlexService": true,

  "routingDefaults": {

    "flexCallAndRideReluctance": 3,

    "flexMaxCallAndRideSeconds": 7200,

    "flexFlagStopExtraPenalty": 180

  }

}

I also tried to set up the Baden-Wuettemberg case study described by derheurst in https://githubmemory.com/repo/mfdz/OpenTripPlanner/issues/64 , using a flex-specialized .jar.

What buzzes me is that I always create and load the graph.obj like a breeze, BUT:

- using the 4 "flex*" travel by options I never get an itinerary

- using the default "Transit" travel by option I get results (itineraries with no hints to flexible/on-demand services)

Am I missing something? OTP is a wonderful thing but the sketchy documentation sometimes drives me mad...

best regards,

Roberto

Leonard Ehrenfried

unread,
Jul 28, 2021, 3:27:34 PM7/28/21
to opentrippl...@googlegroups.com
Flex is very new and a complex topic.

We managed to get it working for our client but it took significant effort.

The only thing I can advise is to triple-check your feed and perhaps build one with only flex routes and check if something shows up.

Also, if you use one of the GraphQL APIs you can get more information out of it to check what type of trip you're dealing with.

Best.
--
  Leonard Ehrenfried


Reply all
Reply to author
Forward
0 new messages