Skip to content

fix: treat a GetFeatureInfo value of 0 as data in the map tooltip - #235

Merged
mluena merged 1 commit into
developfrom
fix/tooltip-zero-value-is-data
Sep 7, 2026
Merged

mluena merged 1 commit into
developfrom
fix/tooltip-zero-value-is-data

Conversation

@mluena

@mluena mluena commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Overview

Clicking the map on Bare soil fraction (BSF) dynamics (2000-2022) (soil monitor, m3, layer l6) showed "No data is available at this specific location" and no "Show point histogram" button on almost every click, even though /point-query returns a full 23-year series at those points.

Root cause is in the tooltip, not in the data. src/components/map/tooltip/index.tsx decided hasValue with value !== 0, so a GetFeatureInfo pixel value of 0 was 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. 0 now offers the point histogram like any other value.

Not covered here: GeoServer's nodata sentinel. Over the sea GetFeatureInfo returns 255 for this layer, which the tooltip already accepted as data before this PR and still does; the histogram then renders empty because /point-query returns 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

  1. Open /explore/monitor/m3, activate Bare soil fraction (BSF) dynamics (2000-2022).
  2. Click on forest or grassland anywhere in Europe (e.g. central Germany). Before: "No data is available at this specific location". After: coordinates plus "Show point histogram"; the histogram shows a series, mostly zeros with some 16/33 years.
  3. Click on a ploughed field or a city; behaviour unchanged, histogram with higher values.
  4. Click on the sea. Behaviour unchanged from develop (button shown, empty histogram); see the note above.
  5. With the regions layer on, click a NUTS region; "Show region histogram" still appears and the region histogram loads.
  6. yarn test e2e/map.spec.ts -g "map tooltip": 5 tests, two of them new (GetFeatureInfo 0 offers the histogram, null withholds it).

Feature relevant tickets

No ticket. Reported directly.


Checklist before submitting

  • Meaningful commits and code rebased on develop.
  • Update CHANGELOG
  • If this PR adds feature that should be tested for regressions when
    deploying to staging/production, please add brief testing instructions
    to the deploy checklist

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).
@mluena
mluena deployed to production September 7, 2026 13:54 — with GitHub Actions Active
@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
oemc Ready Ready Preview Sep 7, 2026 1:55pm UTC

Request Review

@mluena
mluena merged commit 379bdf1 into develop Sep 7, 2026
2 checks passed
@mluena
mluena deleted the fix/tooltip-zero-value-is-data branch September 7, 2026 14:00
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

Successfully merging this pull request may close these issues.

1 participant