fix: treat a GetFeatureInfo value of 0 as data in the map tooltip - #235
Merged
Merged
Conversation
The tooltip hid the point histogram and reported "No data is available at this specific location" whenever GetFeatureInfo returned 0. For fractions, counts and sums that is the common case: Bare soil fraction (BSF) dynamics is 0 over most of Europe, and the point query still returns a full 23-year series there, so users saw "no data" on nearly every click. Only a missing or non-numeric value now counts as no data. Two e2e cases cover 0 (histogram offered) and null (withheld).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Clicking the map on Bare soil fraction (BSF) dynamics (2000-2022) (soil monitor,
m3, layerl6) showed "No data is available at this specific location" and no "Show point histogram" button on almost every click, even though/point-queryreturns a full 23-year series at those points.Root cause is in the tooltip, not in the data.
src/components/map/tooltip/index.tsxdecidedhasValuewithvalue !== 0, so a GetFeatureInfo pixel value of0was treated as "nothing here". BSF is a yearly sum of bare-soil detections at 30 m with values 0, 16, 33, 50, 66, 83, 100; forest, grassland and permanent crops are a legitimate 0, which is most of Europe. The rule dates from the first histogram commit (July 2025) and was carried into the tooltip refactor (May 2026) with no ticket or comment behind it.The change: only a missing or non-numeric GetFeatureInfo value counts as no data.
0now offers the point histogram like any other value.Not covered here: GeoServer's nodata sentinel. Over the sea GetFeatureInfo returns
255for this layer, which the tooltip already accepted as data before this PR and still does; the histogram then renders empty because/point-queryreturns nulls there. Fixing that properly needs the layer's nodata value from GetCapabilities or the API, and is out of scope.Designs
N/A
Testing instructions
/explore/monitor/m3, activate Bare soil fraction (BSF) dynamics (2000-2022).develop(button shown, empty histogram); see the note above.yarn test e2e/map.spec.ts -g "map tooltip": 5 tests, two of them new (GetFeatureInfo0offers the histogram,nullwithholds it).Feature relevant tickets
No ticket. Reported directly.
Checklist before submitting
develop.deploying to staging/production, please add brief testing instructions
to the deploy checklist