Skip to content
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

Clarify how to distinguish a TemporalDimension with an AdditionalDimension object where type = 'temporal' #5

Closed
lossyrob opened this issue Apr 30, 2021 · 5 comments
Milestone

Comments

@lossyrob
Copy link
Contributor

The spec says an AdditionalDimension object can have type 'temporal'. It's unclear to me how one would look at the JSON of a Temporal or Additional dimension with type 'temporal' and determine which one it is. Are client libraries checking if the values are ISO 8601 compliant and making the determination off of that?

@m-mohr
Copy link
Contributor

m-mohr commented Apr 30, 2021

If you specify an additional dimension with type = temporal, the reference system should be set otherwise the temporal information is pretty meaningless. The ISO8601 temporal dimension doesn't have a reference system. Also, the extent is an array of strings for ISO 8601, which is not the case for the additional dimension (array of numbers). Feel free to re-open if that answer is not sufficient. :-)

@m-mohr m-mohr closed this as completed Apr 30, 2021
@lossyrob lossyrob reopened this Apr 30, 2021
@lossyrob
Copy link
Contributor Author

Should the reference system then be required if the type is temporal and it's an additional dimension? There could be language in the extension spec that then says that's the recommended way to distinguish an additional temporal dim from a temporal dim. Otherwise checking the datatype on the extent feels like a pretty brittle way to have the distinction be machine-readable, and insufficient as the extent is optional.

The addition of the requirement of a reference system seems like it could be an sufficient differentiator if the spec language made it required in the temporal case, or else some other distinguishing factor should be put into place. This was discovered while implementing datacube in PySTAC and trying to determine which type the thing was, so I'm sure would be hit by other client authors if they don't push that distinction down to the user, who would also not be able to clearly make the call in a machine-readable way currently.

@m-mohr
Copy link
Contributor

m-mohr commented Apr 30, 2021

extent is required in temporal dimension so a check for type == "temporal" and extent is array of strings/null detects the temporal dimension. All others are additional dimensions. But indeed the array of strings detection is not very nice to implement. I'm not sure we should introduce additional requirements, then it's basically a different Dimension Object again.

@lossyrob
Copy link
Contributor Author

lossyrob commented May 1, 2021

Ah, I see, was confused there. I was thinking about distinguishing an additional, but the process is first to check the extent to see if it exists, and then if it contains strings, and then you have a temporal, otherwise it's additional. Not a great process but at least one exists. Keeping this issue open as I think the README should outline this more clearly; I'll put it on my list of PRs to get to unless someone beats me to it :-)

m-mohr added a commit that referenced this issue Jul 23, 2021
@m-mohr
Copy link
Contributor

m-mohr commented Jul 23, 2021

Clarified.

@m-mohr m-mohr closed this as completed Jul 23, 2021
m-mohr added a commit that referenced this issue Jul 23, 2021
@m-mohr m-mohr added this to the v2.0.0 milestone Jul 23, 2021
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

No branches or pull requests

2 participants