public-transport / friendly-public-transport-format

A format for APIs, libraries and datasets containing and working with public transport data.
Creative Commons Attribution Share Alike 4.0 International
125 stars 1 forks source link

add protocol buffer definitions? #3

Closed hansthompson closed 7 years ago

hansthompson commented 7 years ago

Hi. I like to play around with public transit data like I'm sure you do to.

I'm interested in how you would frame the argument of your format vs. a real-time protocol buffer.

https://developers.google.com/protocol-buffers/

There is a protocol buffer specifically for sending real time data for public transit.

https://developers.google.com/transit/gtfs-realtime/reference/

derhuerst commented 7 years ago

@juliuste and me created many JS modules related to public transport, each returning data in a very similar structure. To make these modules fully interoperable and have this structure written down somewhere, we created the Friendly Public Transport Format (FPTF).

One of the most important reasons we don't use plain GTFS is that it is very cumbersome to work with. FPTF aims to be very consumer-friendly.

It would be a perfectly valid use-case to store FPTF data encoded as protocol buffers and we might want to add .proto definitions soon!

derhuerst commented 7 years ago

Also note that GTFS Realtime, with its nested structures, is a lot more convenient than normal GTFS (just plain CSV). As this format intends to also (and mainly?) cover static/planned data and trip planning, it makes sense to also have a less database-like format in these areas.

derhuerst commented 7 years ago

I think it would make sense to add Protocol Buffer definitions to this repo that match the spec.

derhuerst commented 7 years ago

From https://github.com/public-transport/friendly-public-transport-format/pull/20#issuecomment-339103222

My point is that you can't use oneof to assign two possible types to one name such as region. You have to use region & regionRef.

repeated doesn't work inside a oneof declaration.