Open michaelandrewkearney opened 6 months ago
This issue brings up what the meaning of empty and 0 values are. While thinking about this, I asked myself:
Based on these questions, four potential redefinitions of the stair_count field and what they could mean are:
Making the stair_count value conditionally required if pathway_mode = 2 does not fix the issue of a walkway defining stair_count, so I won't write that out.
I think the best options are 1 and 2. This replaces the intent of the non-zero constraint with conditionally forbidding stair_count for non-stairs. Option 2 has no ambiguity in the meaning of values, and the ambiguity in Option 1 could be clarified easily and might enable better representation of the accessibility of all the different type of pathways. However, neither option is backwards compatible with any non-stairs pathways that stair_count defined (even if defined as 0). Given that this seemed to be part of the intent behind the non-null constraint, maybe this is desired.
Hey @michaelandrewkearney! Thanks for posting this here! We appreciate your first contribution to GTFS and we are happy to have you with us. I am sure the community will get back to you in no time. We are also taking the time to review your issue at MobilityData.
While you wait, I would like to invite you to the MobilityData slack where you can join in on the realtime chat and engage with the rest of the GTFS community.
Hey @michaelandrewkearney! thanks for such a detailed breakdown of the issue with stair_count and the options you put forward, the pragmatism used to illustrate all implications is very much appreciated. Unfortunately, backward compatibility will probably be a tough impediment to adopt any of these changes, but we took a look anyways and based on the feeds available in the Mobility Database and found that there’s only a handful of feeds that use stair_count, in which its use is limited only to stairways and escalators (pathway_mode = 2
and 4
), thus in the hypothetical case this would be implemented, that would probably represent a low impact on existing feeds. Please note that the MobilityDatabase unfortunately isn’t a comprehensive list of all GTFS at this point, thus any results drawn from this could only be considered partial.
Also, as you correctly pointed out, there’s currently an inconsistency with the type of field used as a non-null integer is not defined in the specification. Perhaps we might be able to clarify this and propose a change to make it a non-zero integer which might follow the approach of option 2, leaving less room for ambiguity. But in any case it would be interesting to hear from folks producing and consuming pathways to better understand if there would be interest/support for any changes.
Introduce yourself
Hi all! I'm Michael. I'm new here. I'm not a part of any GTFS producing/consuming organization. Just a daily rider!
Ask a question
The GTFS spec defines three sign constraints for numeric fields: non-negative, non-zero, and positive. They are currently applied to integer (e.g. frequencies.headway_secs) and float (e.g. pathways.length) field types. Presumably, they could also apply to currency_amount fields. Currently, no field has more than 1 sign constraint.
One field has a constraint that is not defined. pathways.stair_count is constrained as a "non-null integer". What could "non-null" mean?
The short resolution to this issue is that the field type could be changed to "non-zero integer".
The much longer resolution would be... if the field definition has to change to align with the accepted sign constraints, maybe this is an opportunity to further clarify the spec. The non-zero constraint seems to exist to prevent "stairs" with 0 steps. However, it also means that a "walkway" must either leave stair_count undefined or define it with a non-zero number of steps. If a walkway having a stair_count is allowed, then a 0 value should be allowed (even though this is redundant) and the field should not be non-zero constrained. If a walkway having a stair_count is not allowed, then the field can be non-zero constrained but it should also be conditionally forbidden for non-stairs pathways. Is there any reason why the field should not be conditionally forbidden and still be constrained to non-zero integer?
TL;DR: The field type of stair_count is not well defined. A quick fix it to make it "non-zero". I think a better fix is to make it conditionally forbidden (and maybe also non-zero).