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

TimeLine component for time ranges - Filter does not work correctly #9268

Closed
1 task done
ale-cristofori opened this issue Jul 3, 2023 · 7 comments · Fixed by #9570
Closed
1 task done

TimeLine component for time ranges - Filter does not work correctly #9268

ale-cristofori opened this issue Jul 3, 2023 · 7 comments · Fixed by #9570

Comments

@ale-cristofori
Copy link
Contributor

ale-cristofori commented Jul 3, 2023

Description

The 'show only times available in the current viewport' filter for the timeline component does not seem to be working correctly. The functionality does not work when no features are present in the viewport (no bars should be shown in the timeline component) and for other types of data the display of the bars seems to be inconsistent with the number of features in the viewport.

How to reproduce

  • Open this map
  • There are two time range layers (test_time and donut_2011)
  • Zoom to an area where you expect to see no features at all (in the middle of the pacific ocean)
  • Activate the filter with the show only times available in the current viewport
  • For the layer donut_2011 only the filter function won't work even in areas where you expect to see only one feature, some features are removed/filtered but most of them aren't. The filter is inconsistent.

Expected Result
For the layer test_time The bars in the timeline histograms should disappear since there should be no feature visible in that remote area. For the layer donut_2011 only when only one feature is displayed in the map viewport only one bar should be displayed in the histogram.

Current Result
For the layer test_time The bars in the timeline histograms show as if they were not filtered even though no features are visible in that remote area. For the layer donut_2011 only when only one feature is displayed in the map viewport many more bars are displayed in the histogram.

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

recording_1.mp4
@ale-cristofori
Copy link
Contributor Author

ale-cristofori commented Jul 3, 2023

These issues are part of the Timeline bugs resolutions development, part of

#9208 (MapStore issue)

@offtherailz
Copy link
Member

offtherailz commented Oct 6, 2023

Solution

I found that the change here was not correct.

https:/geosolutions-it/MapStore2/pull/9209/files#diff-095002aa52f8200d12e455eb4f6153f19d26f4ce313b52a4993c3cc4b5f02267R136

In fact in case that histogram and domain are both absent, it shows the list of values from domain. Instead is should always give priority to range data, that tells that no data is present at all.

Investigation notes

The investigation was a little conplcated because i found some initial issued that looked to be the root of the problem but they was not.

In particular I found some problems that made my investigation a little complicated: here I log all the rest of the investigation that can be useful.

  1. First the problem seemed to be related to the bbox returned by openlayers for the given given map, at least locally. I noticed later that this issue happened during debug only, so it was not the cause of the issue.
    I report my investigation results anyway, if someone may have the same issue.

In fact when panning and sooming the bbox on the state of the map, even if I zoom the full world extent, is always something like:

{
  bounds: {
    minx: 741527152488.8824,
    miny: -775530.3289157422,
    maxx: 741547092157.829,
    maxy: 12256677.245593667
  }
}

With minx values and miny values very near. This is returned directly by this function here:

let bbox = view.calculateExtent(this.map.getSize());

The data returned makes non-sense. Probably related to this issue already notified to openlayers team

openlayers/openlayers#14218

Other maps like the meteorite landings one, do not have this issue.

So i tried to add the meteorite landing map the donuts layer and it works.

http://localhost:8081/?debug=true/#/viewer/46341

Now we have to find out the differences between the map that works and the map that do not work, and what makes openlayers get mad.

  1. First of all I found another bug I notify. Not strictly related to this issue. This happens in the case the timeline is closed but the filter by viewport is active. When panning:

const dataRange = timeData.domain.split('--');

This line doesn't take into account the case when the domain returns an array. In this case I have an error in console.

EpicsUtils.js:28 Error in epic "updateRangeDataOnRangeChange". Original error: TypeError: Cannot read properties of null (reading '0')
    at roundResolution (TimeUtils.js:193:65)
    at roundRangeResolution (TimeUtils.js:212:22)
    at loadRangeData (timeline.js:133:78)
    at eval (timeline.js:431:95)
    at Array.map (<anonymous>)
    at SwitchMapSubscriber.eval [as project] (timeline.js:431:85)
[...]
EpicsUtils.js:31 Uncaught TypeError: Cannot read properties of null (reading '0')
    at roundResolution (TimeUtils.js:193:65)
    at roundRangeResolution (TimeUtils.js:212:22)
    at loadRangeData (timeline.js:133:78)
    at eval (timeline.js:431:95)
    at Array.map (<anonymous>)
    at SwitchMapSubscriber.eval [as project] (timeline.js:431:85)
    at SwitchMapSubscriber._next (switchMap.js:88:27)
    at Subscriber.next (Subscriber.js:89:18)
    at OuterSubscriber.notifyNext (OuterSubscriber.js:19:26)
    at InnerSubscriber._next (InnerSubscriber.js:23:21)
    at Subscriber.next (Subscriber.js:89:18)
    at DebounceTimeSubscriber.debouncedNext (debounceTime.js:98:30)
    at AsyncAction.dispatchNext (debounceTime.js:114:16)
    at AsyncAction._execute (AsyncAction.js:111:18)
    at AsyncAction.execute (AsyncAction.js:86:26)
    at AsyncScheduler.flush (AsyncScheduler.js:36:32)

anyway this is not properly related to this case.

@ale-cristofori
Copy link
Contributor Author

ale-cristofori commented Nov 24, 2023

Hello @offtherailz, I am testing with the donut 2011. And comparing it with dev (that does not have the fix). I built the war and running a local instance of Tomcat connecting to GS-Stable.
I can see the bars representing the intervals appearing and disappearing and an infinite loop error in the JS console see below. The graphics behaves buggy. See below

THIS IS THE PR BRANCH BEHAVIOUR
https:/geosolutions-it/MapStore2/assets/14953970/2903d22f-bf9c-47d1-8d05-cfad7569135b

THIS IS THE DEV BEHAVIOUR
https:/geosolutions-it/MapStore2/assets/14953970/77289e55-c81d-42c7-8e63-72de0f91b004

@offtherailz
Copy link
Member

I comment just for making note that the issue was probably due to a wrong map center calculation that makes OL generate wrong bboxes for filtering.
Anyway, it is not clear the cause that generated the map reported. I attach the map here:

map_15_vlanderen.json

the issue is cause by the center.x

{"version":2,"map":{"center":{"x":6662525.329597231,"y":50.652011207093054,"crs":"EPSG:4326"} ...}

dsuren1 pushed a commit that referenced this issue Dec 1, 2023
* #9268 Fixed domain ranges priority issue

* Fixed domain range error in console
@ElenaGallo ElenaGallo added this to the 2024.01.00 milestone Dec 4, 2023
@ElenaGallo ElenaGallo self-assigned this Dec 5, 2023
@ale-cristofori
Copy link
Contributor Author

ale-cristofori commented Dec 20, 2023

@tdipisa, this issue needs to be re-opened to allow further testing on the latest issue found by the client.
If a new issue to cover this newly found issue is required, let me know.

Issues found by client;
client signals still some issues in the filtering of BBOX domains, I just paste the failing URL here, did not have time to test yet, but this should retrieve no domains instead of 5.

DECODED URL
https://mapstore-geoserver-dev.gis.cloud.mow.vlaanderen.be/geoserver/gwc/service/wmts?service=WMTS&REQUEST=DescribeDomains&version=1.0.0&layer=staf:gip2021_2112_donut&tileMatrixSet=EPSG:4326&bbox=369826.14455835545,6666941.938450555,369837.7146163478,6666950.494695055,EPSG:3857&expandLimit=20&time=2021-01-01T00:00:00.000Z/2026-12-06T02:17:39.542Z

We tested the BBOX plotting it on the map and focusing on map area and, even if we cannot replicate the same exact map focus, we can still see there are features that are not correctly filtered on the TimeLine bar, while they are not visible on the map, domains from the DescribeDomains are still returned.

At this stage, we cannot be sure where the issue might be (Front-End or Back-End) could check the cause on this example map and see if it is related to MapStore and fix? Thanks

the test map
https://dev-mapstore.geosolutionsgroup.com/mapstore/#/viewer/46334

an example of a non-applied filter
https:/geosolutions-it/support/assets/14953970/954f8639-f1cb-4d0e-a4bb-09a14fa1c5ac

@tdipisa
Copy link
Member

tdipisa commented Dec 20, 2023

@ale-cristofori please open a new issue reporting the steps to reproduce etc as usual. Assign the same milestone please. Thank you.

@ale-cristofori
Copy link
Contributor Author

closed in favour of #9843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants