Unidata / ncWMS

Snapshots of ncWMS used by TDS
8 stars 7 forks source link

getTimeStringForCapabilities() can't handle yearly or monthly intervals properly #41

Closed WeatherGod closed 2 years ago

WeatherGod commented 2 years ago

https://github.com/Unidata/ncWMS/blob/8f66cd953a32e1b44e8bbd9367a39442962d64e4/src/java/uk/ac/rdg/resc/ncwms/util/WmsUtils.java#L547

The algorithm here works by joining together contiguous intervals of equal time as measured by milliseconds. This results in "weird" lists for monthly datasets because only December-January and July-August are equal in time.

As an example, for my monthly dataset, even though "timeInterval" is set to true in wmsConfig.xml, I get the following in my capabilities document, which is mostly a list which is likely to cause confusion.

<Dimension name="time" units="unknown" multipleValues="true" current="true" default="2022-05-01T00:00:00.000Z">
 2020-01-01T00:00:00.000Z,2020-02-01T00:00:00.000Z,2020-03-01T00:00:00.000Z,2020-04-01T00:00:00.000Z,2020-05-01T00:00:00.000Z,2020-06-01T00:00:00.000Z,
2020-07-01T00:00:00.000Z/2020-09-01T00:00:00.000Z/P31D,2020-10-01T00:00:00.000Z,2020-11-01T00:00:00.000Z,
2020-12-01T00:00:00.000Z/2021-02-01T00:00:00.000Z/P31D,2021-03-01T00:00:00.000Z,2021-04-01T00:00:00.000Z,2021-05-01T00:00:00.000Z,2021-06-01T00:00:00.000Z,
2021-07-01T00:00:00.000Z/2021-09-01T00:00:00.000Z/P31D,2021-10-01T00:00:00.000Z,2021-11-01T00:00:00.000Z,
2021-12-01T00:00:00.000Z/2022-02-01T00:00:00.000Z/P31D,2022-03-01T00:00:00.000Z,2022-04-01T00:00:00.000Z,2022-05-01T00:00:00.000Z
 </Dimension>

As a side note, it appears that setting timeInterval to false doesn't do anything? I get the same result either way (using tds 5.4-snapshot docker image)

haileyajohnson commented 2 years ago

Hi @WeatherGod , this repository is no longer under active development and will be archived when we end support for TDS 4.6.x.

TDS 5.x uses edal-java for wms, which is forked from this external repo. Most wms-related bugs will need to be reported there.

However, we are aware of the timeInterval parameter not working as expected and are looking into it.

WeatherGod commented 2 years ago

Thanks, I'll track it down in edal and see if it is the same cause or not and open an issue there.

WeatherGod commented 2 years ago

Actually, I'm not clear how capabilities_xml.jsp finds getTimeStringForCapabilities(). The tld file associates this function with the class defined here, but I don't see the function there.

Shall I go ahead and just open an issue in edal-java and let you all figure it out, or what would you advise?

haileyajohnson commented 2 years ago

Yes, either open an issue on the main edal-java repo or the tds repo (if your issue is a thredds problem)

WeatherGod commented 2 years ago

Done: https://github.com/Reading-eScience-Centre/edal-java/issues/145