How to post router-config to an OTP server

689 views
Skip to first unread message

Ulrich Strötz

unread,
Dec 4, 2015, 12:16:50 PM12/4/15
to OpenTripPlanner Developers
Hello all,

I am trying to get OTP working with GTFS-RT under the given setup below:

I have an OTP server running with:

java -Xmx6G -jar otp-0.19.0-shaded.jar --server --insecure

Next I build a graph with:

java -Xmx6G -jar otp-0.19.0-shaded.jar --build /data

My data dir contains Portland's GTFS file and a router-config.json. The router-config is the following:

{
   
"updaters": [{
       
"url": "http://developer.trimet.org/ws/V1/FeedSpecAlerts/appID/7AD4C25BABC8B017651A55C18",
       
"frequencySec": 30,
       
"defaultAgencyId": "TRIMET",
       
"type": "real-time-alerts"
   
}]
}


The router-config.json is picked up on graph build:

Found and loaded JSON configuration file '/data/router-config.json'



Next I post the graph to my local server:

curl -T Graph.obj  -H "Content-Type: application/octet-stream" -X POST http://localhost:8080/otp/routers/test

The OTP server logs:

INFO (GraphService.java:190) Registering new router 'test'
INFO
(Router.java:84) No default routing parameters were found in the router config JSON. Using built-in OTP defaults.
INFO
(Router.java:111) Timeouts for router 'test': [5.0, 2.0, 1.0, 0.5, 0.1]
INFO
(GraphUpdaterConfigurator.java:57) Using configurations: [main]


OTP doesn't seem to pick up the router-configuration specified in the graph. I assume I have to specify it in a different way. Is there a way to add GTFS-RT to a running OTP instance?


Any help or hints are appreciated!


Thanks,

Uli


Marcus Young

unread,
Dec 5, 2015, 3:46:26 AM12/5/15
to OpenTripPlanner Developers
Have you seen:

http://docs.opentripplanner.org/en/latest/Configuration/

Router-config.json is read at runtime, not during build.

Marcus

Andrew Byrd

unread,
Dec 5, 2015, 5:49:15 AM12/5/15
to Ulrich Strötz, OpenTripPlanner Developers
Hello,

If I remember correctly, it is indeed possible to embed the router configuration in the graph so a default runtime configuration is POSTed along with the graph itself. If this is not clearly explained in the official documentation (and I don’t think it is) please create a Github issue and we’ll update the docs (and/or fix the problem if this capability has somehow been disabled).

Andrew

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Uli Strötz

unread,
Dec 5, 2015, 6:08:26 AM12/5/15
to Andrew Byrd, OpenTripPlanner Developers
Testing and reading the documentation it seems like it is only possible to specify a router-config.json at runtime. So I have to register a new graph and the router-config.json needs to be on the server in order that OTP recognises it. 

Since we would like to add dynamically new routers it would be good to be able to post the router configuration embed in the graph. It seems like when building the graph the router configuration is embed, but when reading the graph, OTP ignores the configuration inside the graph.


If you point me to the right resource I will send a PR with proper documentation.
--
Uli Strötz
GIS Developer

ally | local transport app

Making Cities Smarter.

    
Reply all
Reply to author
Forward
0 new messages