google / google/transit

Clarifying constraints on pathways.stair_count

Open
#437 4 comments 1 reaction 0 assignees View on GitHub
Change type: Non-Functional Discussion Period GTFS Schedule Status: Stale Support: Needs Help
Dominant language
No language data
Stars
1.1k
Forks
225
Avg merge
7d 17h
Merged PRs (30d)
3

Description

### 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](https://gtfs.org/schedule/reference/#field-signs) 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?
- If it means the value cannot be 0, should the field be a "non-zero integer" with no requirement?
- If it means the value cannot be empty (and 0 is a valid value), should the field be "integer" and be (conditionally) required?
- Could it mean both non-zero and non-empty?

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).**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.