Skip to content

Field types (Leo's) - #2

Closed
LeoFrachet wants to merge 30 commits into
masterfrom
field_types_2
Closed

Field types (Leo's)#2
LeoFrachet wants to merge 30 commits into
masterfrom
field_types_2

Conversation

@LeoFrachet

Copy link
Copy Markdown

I've removed the definition which weren't about data type for now (required, optional...)

As explained in https://github.com/MobilityData/Tasks/issues/3, I've focused on factorizing the definition appearing multiple times in the existing spec.

Comment thread gtfs/spec/en/reference.md Outdated
- **ID** - The field contains an identifier which uniquely identifies an entity (therefore is dataset unique). Its value is not aimed to be displayed to the user, and is a sequence of any UTF-8 characters, but using only printable ASCII characters is recommended.
- **Positive Integer** - The field contains a non-negative whole number (which includes 0).
- **Language Code** - The field contains a IETF BCP 47 language code. For an introduction to IETF BCP 47, please refer to http://www.rfc-editor.org/rfc/bcp/bcp47.txt and http://www.w3.org/International/articles/language-tags/. E.g. "en" for English, "en-US" for American English or "de" for German.
- **Latitude** - The field contains the WGS84 latitude as a float number (it includes decimals). The value must be higher and -90.0 and smaller than 90.0.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For lat and long, I would change this to a floating point (i.e., decimal) number

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change to `The value must be greater than or equal to -90.0 and less than or equal to 90.0."

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. But I removed the (i.e.,decimal) which was cutting the definition in half and I got stuck at "what is a floating point?"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding an example at the end.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So technically this should actually read The field contains the WGS84 latitude in decimal degrees.

"decimal degrees" is the way the numeric decimal format is usually described (as opposed to degrees/minutes/seconds).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment thread gtfs/spec/en/reference.md Outdated
- **Positive Integer** - The field contains a non-negative whole number (which includes 0).
- **Language Code** - The field contains a IETF BCP 47 language code. For an introduction to IETF BCP 47, please refer to http://www.rfc-editor.org/rfc/bcp/bcp47.txt and http://www.w3.org/International/articles/language-tags/. E.g. "en" for English, "en-US" for American English or "de" for German.
- **Latitude** - The field contains the WGS84 latitude as a float number (it includes decimals). The value must be higher and -90.0 and smaller than 90.0.
- **Longitude** - The field contains the WGS84 longitude as a float number (it includes decimals). The value must be higher and -180.0 and smaller than 180.0.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change to `The value must be greater than or equal to -180.0 and less than or equal to 180.0."

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread gtfs/spec/en/reference.md Outdated
- **Language Code** - The field contains a IETF BCP 47 language code. For an introduction to IETF BCP 47, please refer to http://www.rfc-editor.org/rfc/bcp/bcp47.txt and http://www.w3.org/International/articles/language-tags/. E.g. "en" for English, "en-US" for American English or "de" for German.
- **Latitude** - The field contains the WGS84 latitude as a float number (it includes decimals). The value must be higher and -90.0 and smaller than 90.0.
- **Longitude** - The field contains the WGS84 longitude as a float number (it includes decimals). The value must be higher and -180.0 and smaller than 180.0.
- **Service Date** - The field contains the service date in the YYYYMMDD format. Since service time within a service date can be above 24:00:00, a service date often contains information for the subsequent day(s). E.g "20180913" for Septembre 13th, 2018.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use the U.S. English spelling for Septembre instead - September

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grrrrrr.

I totally agree, but my fingers are so confused. I've spent the last 13 days fighting when I'm writing "septembre" in French, that I'm writing "Septembre", and I see that now I have it back in French, I'm mixing it in English.

Comment thread gtfs/spec/en/reference.md Outdated
- **Longitude** - The field contains the WGS84 longitude as a float number (it includes decimals). The value must be higher and -180.0 and smaller than 180.0.
- **Service Date** - The field contains the service date in the YYYYMMDD format. Since service time within a service date can be above 24:00:00, a service date often contains information for the subsequent day(s). E.g "20180913" for Septembre 13th, 2018.
- **Service Time** - The field contains the service time in the HH:MM:SS format (H:MM:SS is also accepted). The time is measured from "noon minus 12h" of the service day (effectively midnight except for days on which daylight savings time changes occur). For times occurring after midnight, enter the time as a value greater than 24:00:00 in HH:MM:SS local time for the day on which the trip schedule begins. E.g. "14:30:00" for 2:30PM or "25:35:00" for 1:35AM on the next date.
- **Text string** - The field contains a string of UTF-8 caracters, which is aimed to be displayed to the rider and which must therefore be readable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

caracters -> characters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readable -> human readable.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread gtfs/spec/en/reference.md Outdated
- **Service Date** - The field contains the service date in the YYYYMMDD format. Since service time within a service date can be above 24:00:00, a service date often contains information for the subsequent day(s). E.g "20180913" for Septembre 13th, 2018.
- **Service Time** - The field contains the service time in the HH:MM:SS format (H:MM:SS is also accepted). The time is measured from "noon minus 12h" of the service day (effectively midnight except for days on which daylight savings time changes occur). For times occurring after midnight, enter the time as a value greater than 24:00:00 in HH:MM:SS local time for the day on which the trip schedule begins. E.g. "14:30:00" for 2:30PM or "25:35:00" for 1:35AM on the next date.
- **Text string** - The field contains a string of UTF-8 caracters, which is aimed to be displayed to the rider and which must therefore be readable.
- **Timezone** - The field contains a TZ timezone from the TZ database. Timezone names never contain the space character but may contain an underscore. Refer to http://en.wikipedia.org/wiki/List_of_tz_zones for a list of valid values. E.g. "Asia/Tokyo", "America/Los_Angeles" or "Africa/Cairo".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd hyperlink the TZ database.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread gtfs/spec/en/reference.md Outdated

## Field Types

- **Ad-hoc** - Please see the detail column of the field for the definition of the field type.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which fields would this describe? Without knowing that, I think Misc is probably a better value.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've mainly done it for currency_type(ISO 4217) and agency_phone (which should be E123 but currently isn't specified as such).

But to answer your question I've checked every field and it could also be used for:

  • agency_email, feed_contact_email (but I can add a type for that now that I see there are two of them)
  • shape_dist_traveled (positive float)
  • price (positive float)
  • feed_version (not an ID, not really a Text string)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must confess I don't like "Misc", it sounds as "what we haven't sorted". Ad-hoc is distinct, it is saying that the format is distinct.

But if another anglo endorse the "Misc", I'll go for it. @antrim?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must confess I don't like "Misc", it sounds as "what we haven't sorted".

Isn't that what it is :)?

I'm not married to "Misc", but "Ad-Hoc" definitely doesn't sound right. To me in English "Ad-Hoc" implies something that's a "one-off" or something done once for a particular purpose without organization. To me it almost implies that you could put whatever you want in that field.

Thinking more, I'd actually vote to remove this type entirely and just list all types here, even if they only occur once in the spec.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding the Non-negative float type (roll eyes) and the email type.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding ad-hoc, I'm just gonna remove it.

Comment thread gtfs/spec/en/reference.md Outdated
## Field Types

- **Ad-hoc** - Please see the detail column of the field for the definition of the field type.
- **Color** - The field contains a color encoded as a six-character hexadecimal number. Refer to https://htmlcolorcodes.com/ to generate a valid value. E.g. "FFFFFF" for white, "000000" for black or "0039A6" for the A,C,E lines in NYMTA.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

six-character -> six-digit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add ...hexadecimal number. A leading "#" is not included.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding the # comment after the "valid value". Because when you read the definition as "a six-character hexadecimal number", you don't see why we speak about not including the #. There is no hash in a six-character hexadecimal number.

Comment thread gtfs/spec/en/reference.md Outdated

- **Ad-hoc** - Please see the detail column of the field for the definition of the field type.
- **Color** - The field contains a color encoded as a six-character hexadecimal number. Refer to https://htmlcolorcodes.com/ to generate a valid value. E.g. "FFFFFF" for white, "000000" for black or "0039A6" for the A,C,E lines in NYMTA.
- **Enum** - The field contains a value among a set of ad-hoc predefined constants defined in the "Details" column. E.g. the route_type field contains a "0" for tram, a "1" for subway...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say The field contains a value from...

I would remove ad-hoc.

@barbeau barbeau Sep 13, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to consider replacing all E.g. with For example, to be clearer.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, done and done.

Comment thread gtfs/spec/en/reference.md Outdated
- **Color** - The field contains a color encoded as a six-character hexadecimal number. Refer to https://htmlcolorcodes.com/ to generate a valid value. E.g. "FFFFFF" for white, "000000" for black or "0039A6" for the A,C,E lines in NYMTA.
- **Enum** - The field contains a value among a set of ad-hoc predefined constants defined in the "Details" column. E.g. the route_type field contains a "0" for tram, a "1" for subway...
- **ID** - The field contains an identifier which uniquely identifies an entity (therefore is dataset unique). Its value is not aimed to be displayed to the user, and is a sequence of any UTF-8 characters, but using only printable ASCII characters is recommended.
- **Positive Integer** - The field contains a non-negative whole number (which includes 0).

@barbeau barbeau Sep 13, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As ugly as it is, I think this type must be named Non-negative Integer - "positive" by definition excludes 0.

And, I'd change the definition to The field contains a the value 0 or a positive whole number.

@LeoFrachet LeoFrachet Sep 13, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"positive" by definition excludes 0.

Haha. Oh God. Not in French Math (aka not in real Math). But yeah, I've heard that's how you do Math. It is so confusing. Zero is obviously positive and negative. This is why we have N* and Z*. Anyway... #DontStartMeOnThat #ThisIsWhyWeHave12FieldsMedals #LongLiveNAndZStar

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway. I'll replace "Positiv" by "Non-negative".

Comment thread gtfs/spec/en/reference.md
@barbeau

barbeau commented Sep 13, 2018

Copy link
Copy Markdown
Member

@LeoFrachet I've left a few comments in-line.

@LeoFrachet

Copy link
Copy Markdown
Author

@barbeau: I've answered to most of your comments, accepting most of them (sometime reluctantly).

@LeoFrachet

Copy link
Copy Markdown
Author

@barbeau: updated using your second reviewing.

Comment thread gtfs/spec/en/reference.md Outdated
File: **Required**

| Field Name | Required | Details |
| Field Name | Required & Type | Details |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would separate "Type" into it's own column. GTFS-realtime has:

Field Name Type Required Cardinality Description

For example:
https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/reference.md#message-feedmessage

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we don't need "Cardinality" here

@antrim antrim left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left a few suggestions and comments.

Comment thread gtfs/spec/en/reference.md Outdated
- **Longitude** - The field contains the WGS84 longitude as a a floating point number. The value must be geater than or equal to -180.0 and less than or equal to 180.0. For example: "12.492269" for the Colloseum in Roma.
- **Service Date** - The field contains the service date in the YYYYMMDD format. Since service time within a service date can be above 24:00:00, a service date often contains information for the subsequent day(s). E.g "20180913" for September 13th, 2018.
- **Service Time** - The field contains the service time in the HH:MM:SS format (H:MM:SS is also accepted). The time is measured from "noon minus 12h" of the service day (effectively midnight except for days on which daylight savings time changes occur). For times occurring after midnight, enter the time as a value greater than 24:00:00 in HH:MM:SS local time for the day on which the trip schedule begins. For example: "14:30:00" for 2:30PM or "25:35:00" for 1:35AM on the next date.
- **Text string** - The field contains a string of UTF-8 characters, which is aimed to be displayed to the rider and which must therefore be human readable.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…which is aimed to be displayed to the rider and which must therefore be human readable.

Should we remove that last clause?
stop_desc, route_desc, and feed_version would all be text fields (I think) but are not necessarily intended to be displayed to the rider. Well, actually stop_desc, route_desc have an ambiguous purpose.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feed_version is a stretch I agree. I can remove it.

But description field are often used to be shown to the rider.

Comment thread gtfs/spec/en/reference.md Outdated
- **Non-negative Float** - The field contains a non-negative floating point number (which includes 0).
- **Non-negative Integer** - The field contains a non-negative whole number (which includes 0).
- **Phone number** - The field contains a phone number.
- **Service Date** - The field contains the service date in the YYYYMMDD format. Since service time within a service date can be above 24:00:00, a service date often contains information for the subsequent day(s). E.g "20180913" for September 13th, 2018.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest changing the order of these sentences and a few other language times.

The field contains the service date in the YYYYMMDD format. E.g "20180913" for September 13th, 2018. Because service times can be past 24:00:00, a service date may include transit operations on the subsequent real calendar day(s).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... I agree.

Comment thread gtfs/spec/en/reference.md Outdated
- **Non-negative Integer** - The field contains a non-negative whole number (which includes 0).
- **Phone number** - The field contains a phone number.
- **Service Date** - The field contains the service date in the YYYYMMDD format. Since service time within a service date can be above 24:00:00, a service date often contains information for the subsequent day(s). E.g "20180913" for September 13th, 2018.
- **Service Time** - The field contains the service time in the HH:MM:SS format (H:MM:SS is also accepted). The time is measured from "noon minus 12h" of the service day (effectively midnight except for days on which daylight savings time changes occur). For times occurring after midnight, enter the time as a value greater than 24:00:00 in HH:MM:SS local time for the day on which the trip schedule begins. For example: "14:30:00" for 2:30PM or "25:35:00" for 1:35AM on the next date.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a new term -- "Service Time". I just want to check that everyone is good with this. I think I'd rather just use "Time", because I think that all time fields in GTFS match this definition. I understand what "Service Time" means, but I think it is possible that adding "Service" might add potential for confusion rather than add clarity.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok. But I'm using it with service date, to show that those are not usual date & time. So if you think we should remove it there, then I would advocate to also remove it in service date.

Comment thread gtfs/spec/en/reference.md
- **Language Code** - The field contains a IETF BCP 47 language code. For an introduction to IETF BCP 47, please refer to http://www.rfc-editor.org/rfc/bcp/bcp47.txt and http://www.w3.org/International/articles/language-tags/. For example: "en" for English, "en-US" for American English or "de" for German.
- **Latitude** - The field contains the WGS84 latitude in decimal degrees. The value must be greater than or equal to -90.0 and less than or equal to 90.0. For example: "41.890169" for the Colloseum in Roma.
- **Longitude** - The field contains the WGS84 longitude in decimal degrees. The value must be geater than or equal to -180.0 and less than or equal to 180.0. For example: "12.492269" for the Colloseum in Roma.
- **Non-negative Float** - The field contains a non-negative floating point number (which includes 0).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding "decimal" for people who don't immediately know what "floating point" means.

"The field contains a non-negative floating point number (i.e. allowing decimals), which includes 0."

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also do not find "floating point number" obvious. But I don't know how to be clear on this one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this works - The field contains a non-negative floating point (i.e., decimal) number, which includes 0.

Comment thread gtfs/spec/en/reference.md
- **Latitude** - The field contains the WGS84 latitude in decimal degrees. The value must be greater than or equal to -90.0 and less than or equal to 90.0. For example: "41.890169" for the Colloseum in Roma.
- **Longitude** - The field contains the WGS84 longitude in decimal degrees. The value must be geater than or equal to -180.0 and less than or equal to 180.0. For example: "12.492269" for the Colloseum in Roma.
- **Non-negative Float** - The field contains a non-negative floating point number (which includes 0).
- **Non-negative Integer** - The field contains a non-negative whole number (which includes 0).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the previous change is accepted, then I suggest replacing the parens with a comma for consistency.

Non-negative Integer - The field contains a non-negative whole number, which includes 0.

@LeoFrachet

Copy link
Copy Markdown
Author

The definition of float is still under discussion, but I would advocate to still open this PR on the official repo. the discussion can continue there.

Comment thread gtfs/spec/en/reference.md Outdated
@LeoFrachet

Copy link
Copy Markdown
Author

Move to google#104

@LeoFrachet LeoFrachet closed this Sep 13, 2018
skalexch added a commit that referenced this pull request Jul 13, 2026
# This is the 1st commit message:

add tripupdate clarification

# This is the commit message #2:

fixed formatting

# This is the commit message #3:

Clarify detour description in service alerts

Updated detour description for clarity.
# This is the commit message #4:

Clarify DETOUR effect description in reference.md

Updated the description of the DETOUR effect to clarify that it refers to stops not being served.
# This is the commit message #5:

better detour definition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants