BlinkTagInc / gtfs-to-html

Build human readable transit timetables as HTML or PDF from GTFS.
https://gtfstohtml.com
MIT License
183 stars 56 forks source link

dropoff/pickup modifications without arrival_time #79

Closed ehowington closed 4 years ago

ehowington commented 4 years ago

@brendannee I believe this was a casualty of some of the fine tuning in a few of the more recent updates - I'm finding I can't get on request stops to populate with "R" when there is no arrival_time in stop_times.txt

See attached - last run should have "R" all the way down https://drive.google.com/file/d/1_gRa_TA6-9oqrtE1NyJzi0Zrgg_RbeNw/view?usp=sharing

config { "mongoUrl": "mongodb://localhost:27017/gtfs", "agencies": [ { "agency_key": "EDT", "url": "https://data.trilliumtransit.com/gtfs/eldoradotransit-ca-us/eldoradotransit-ca-us.zip" } ], "beautify": true, "coordinatePrecision": 5, "dateFormat": "MMM D, YYYY", "daysShortStrings": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], "daysStrings": ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], "defaultOrientation": "horizontal", "effectiveDate": "", "interpolatedStopSymbol": null, "interpolatedStopText": null, "linkStopUrls": false, "mapboxAccessToken": "", "menuType": "simple", "noDropoffSymbol": null, "noDropoffText": null, "noHead": true, "noPickupSymbol": null, "noPickupText": null, "noServiceSymbol": "—", "noServiceText": "No service at this stop", "outputFormat": "html", "requestDropoffSymbol": "R", "requestDropoffText": "Request stop - call for drop off", "requestPickupSymbol": "R", "requestPickupText": "Request stop - call for pickup", "serviceNotProvidedOnText": "Service not provided on", "serviceProvidedOnText": "Service provided on", "showArrivalOnDifference": 0.2, "showMap": false, "showOnlyTimepoint": false, "showRouteTitle": false, "showStopCity": false, "showStopDescription": false, "skipImport": false, "sortingAlgorithm": "common", "timeFormat": "h:mma", "verbose": true, "zipOutput": false, "templatePath": "views/trillium" }

brendannee commented 4 years ago

I tried this same config and GTFS and it the "R" symbol did show up for timetable ID 2919

I think you may need to update the custom view template in views/trillium to support showing requestPickupSymbol and requestDropoffSymbol

See the default template for an example of what you need:

https://github.com/BlinkTagInc/gtfs-to-html/blob/master/views/timetable/timetable_stoptime.pug

https://github.com/BlinkTagInc/gtfs-to-html/blob/master/views/timetable/timetablepage.pug#L53-L67

Also you may need to use different symbols for request pickup and request dropoff, or else update your template to show a single symbol if both are true. I can help with this if you'd like, let me know.

If you need help updating your custom GTFS-to-HTML template to use these features, send it to me and I can make and test the changes.

On Wed, Jun 24, 2020 at 2:02 PM evantrillium notifications@github.com wrote:

@brendannee https://github.com/brendannee I believe this was a casualty of some of the fine tuning in a few of the more recent updates - I'm finding I can't get on request stops to populate with "R" when there is no arrival_time in stop_times.txt

See attached - last run should have "R" all the way down

https://drive.google.com/file/d/1_gRa_TA6-9oqrtE1NyJzi0Zrgg_RbeNw/view?usp=sharing

config { "mongoUrl": "mongodb://localhost:27017/gtfs", "agencies": [ { "agency_key": "EDT", "url": " https://data.trilliumtransit.com/gtfs/eldoradotransit-ca-us/eldoradotransit-ca-us.zip " } ], "beautify": true, "coordinatePrecision": 5, "dateFormat": "MMM D, YYYY", "daysShortStrings": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], "daysStrings": ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], "defaultOrientation": "horizontal", "effectiveDate": "", "interpolatedStopSymbol": null, "interpolatedStopText": null, "linkStopUrls": false, "mapboxAccessToken": "", "menuType": "simple", "noDropoffSymbol": null, "noDropoffText": null, "noHead": true, "noPickupSymbol": null, "noPickupText": null, "noServiceSymbol": "—", "noServiceText": "No service at this stop", "outputFormat": "html", "requestDropoffSymbol": "R", "requestDropoffText": "Request stop - call for drop off", "requestPickupSymbol": "R", "requestPickupText": "Request stop - call for pickup", "serviceNotProvidedOnText": "Service not provided on", "serviceProvidedOnText": "Service provided on", "showArrivalOnDifference": 0.2, "showMap": false, "showOnlyTimepoint": false, "showRouteTitle": false, "showStopCity": false, "showStopDescription": false, "skipImport": false, "sortingAlgorithm": "common", "timeFormat": "h:mma", "verbose": true, "zipOutput": false, "templatePath": "views/trillium" }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BlinkTagInc/gtfs-to-html/issues/79, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXPWOTGF74JFSFHZWVXR3RYJSWTANCNFSM4OHJQCCQ .

ehowington commented 4 years ago

thanks for finding the source of the issue, @brendannee - I'll follow up with Nome about the template we're using

sleddd commented 4 years ago

@brendannee I recently took a look at this issue for Evan and found that when there is a pickup_type or drop_off_type greater than zero, in the lib folder - formatters.js ( line 60 and line 76 ) it removes/clears the formatted stop time. We would like to be able to include that stop time in our Trillium template, however, that function makes it very difficult. I was able to create a workaround function to re-format the time in vanilla js in formatting_functions.pug. However, this is not optimal. @brendannee is there a way that we could add a config option to turn stop time formatting on and off for pickup/dropoff types? In our case, we would like to have stop time formatted for all pickup and drop off types, then choose whether to display it or not in the template. Please let me know what can be done at root level if you can. Thanks!

brendannee commented 4 years ago

Thanks for pointing this out.

It seems like maybe we should just remove lines 60 and 76. That way you can customize your template if you wanted to hide these times for some reason, but they would be shown with the requestPickupSymbol or requestDropoffSymbol by default.

Does that seem like a solution that would work? If so, I'll make the needed update.

sleddd commented 4 years ago

Yep. That's the perfect solution. Then you can just control if you want only the symbol, only the time, or both to show as needed in the template. Thanks!

sleddd commented 4 years ago

One thing to consider - will switching the default on this mess some other user up? Are they just expecting the symbol? If so, you might want to adjust the default template as well to deliver the same result as before. Removing the lines is the right solution though as it will allow customizations for other users without them having to hack the stoptime formatting in the template.

brendannee commented 4 years ago

I pushed version 0.21.1 with these changes.

I don't think this will mess up other users as much as fix up something they may have overlooked. My sense is most users actually want to display time times with the requestPickupSymbol or requestDropoffSymbol which was not the case until this change.

This was added to the CHANGELOG.md so anyone upgrading can see what has changed. I'll let you know if I get feedback from others that a global config option to hide these times would be useful.

sleddd commented 4 years ago

Awesome! Thank you!