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

Configure metadata dateFieldsTimeReference and advancedQueryCapabilities #599

Open
despainm opened this issue May 25, 2023 · 1 comment
Open
Labels
enhancement LOE: low Level Of Effort: low

Comments

@despainm
Copy link

It appears the dateFieldsTimeReference and advancedQueryCapabilities fields can not be configured by a provider.

For example, I'd like to set advancedQueryCapabilities.supportsPaginationOnAggregatedQueries = false and I'd like to explicitly set the dateFieldsTimeReference to be

"dateFieldsTimeReference": {
   "timeZone": "UTC",
   "respectsDaylightSaving": false
}

Based on the query api I think a dateFieldsTimeReference = null should be interpreted as UTC by default, but I'd like to explicitly set it.

 If the dateFieldsTimeReference property is not set, it will show up as null and the data will be assumed to be in UTC. In this case make sure you issue your WHERE clause in UTC
@rgwozdz
Copy link
Member

rgwozdz commented Sep 13, 2023

There is a pathway for doing this now. You can add these properties to the set of "overridable defaults" for a layer. To do so, create a PR where you:

  1. Add default values here
  2. Add validation for the override values here.
  3. Use this.#overridables to set values here and here.
  4. Add tests to ensure defaults are overridden as expected.

Once this PR is merged and released, you would instantiate your Koop instance with:

const options = {
  geoserviceDefaults: {
    layer: {
      dateFieldsTimeReference: {
	    timeZone: "UTC",
	    respectsDaylightSaving: false
	  },
	  advancedQueryCapabilities: {
	    supportsPaginationOnAggregatedQueries: false
      }
    }
  }
};

const koop = new Koop(options);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement LOE: low Level Of Effort: low
Projects
None yet
Development

No branches or pull requests

2 participants