-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add detailed description of datetime parameter use #162
Conversation
Thereby, the recommended process for parsing the datetime is: | ||
|
||
1. uppercase the string (this avoids needing to match on both (t|T) and (z|Z)) | ||
2. split the string on `/` to determine if it is a single datetime or an interval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interval semantic was not mentioned before and it's not 100% clear whether the regexp accounts for this case (it does not, but should it?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've clarified the text. The regex is only for parsing a single datetime value.
implementation.md
Outdated
1. uppercase the string (this avoids needing to match on both (t|T) and (z|Z)) | ||
2. split the string on `/` to determine if it is a single datetime or an interval | ||
3. For each value of the split, check if it is either an open interval (the empty string or `..`), or if it matches the RFC3339 datetime regex | ||
5. ISO8601 parse datetime strings using a library such as [pyiso8601](https://github.com/micktwomey/pyiso8601) or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe list two libs for different languages instead of two libs for the same language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added one that looks good for JavaScript. I mostly didn't want to recommend something that I wasn't sure if it worked or not. The main point was the Python's built-in library doesn't work, but I don't know about any other languages. I'm not even sure the Scala/JVM one worked correctly.
implementation.md
Outdated
|
||
These are several examples of datetime intervals: | ||
|
||
- `/` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the meaning of this? The same as ../..
? Where is it specified that you don't need the ..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that I read this again (http://docs.opengeospatial.org/is/17-069r3/17-069r3.html#_parameter_datetime), open start and open end is invalid -- I'll correct that.
As for the empty strings, the ABNF says:
interval-open-start = [".."] "/" date-time
interval-open-end = date-time "/" [".."]
and then later:
"Open ranges in time intervals at the start or end are supported using a double-dot (..) or an empty string for the start/end."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. A nice addition.
Related Issue(s): #146
Proposed Changes:
PR Checklist:
stac-spec
directory (these are included as a subtree and should be updated directly in radiantearth/stac-spec)