opendatacube / datacube-explorer

Web-based exploration of Open Data Cube collections
Apache License 2.0
56 stars 31 forks source link

Incorrect display of region polygons in date summary #484

Closed omad closed 1 year ago

omad commented 1 year ago

While browsing the spatial summary of a DEA Product, there is confusing and wrong display of Dataset regions.

When I mouse over many of the polygons at the above link, Two polygons highlight instead of One, both report the same name and link to the same dataset.

Looking at the source of the GeoJSON, it has lots of Multipolygons instead of simple Polygons. I think each region_code should only be a single Polygon.

2022-11-16_14-28

2022-11-16_14-29

Reporting on behalf of Arek.

Ariana-B commented 1 year ago

I'm wondering if this is due to some sort of processing issue - the observed behaviour seems to always be caused by a single dataset from late November/early December 2015 having the wrong region code (off by the last letter).

JonDHo commented 1 year ago

I have what I suspect is the same issue in our Chile and CEOS instances. What was weird was that it would only happen if I indexed a lot of data at once (e.g. all of continental USA). I have since modified our indexing workflow so that it splits not only on date blocks, but also splits large geographic areas into smaller areas. This has mostly removed the issue, but I could never work out what specifically was causing it. I mostly had the issue with Landsat 8, but I think also with Sentinel-2. The actual bbox in the index database was incorrect as explained below.

This is an example of a bad tile: https://explorer.eail.easi-eo.solutions/products/landsat8_c2l2_sr/datasets/206d355c-8ce8-52a3-b4ef-72e913681684

The geometry and bbox at the STAC endpoint appears to be correct: https://explorer.eail.easi-eo.solutions/stac/collections/landsat8_c2l2_sr/items/f3eaa38d-b383-53e0-8baa-1e3be970c10c

and it has exactly the same geometry and bbox as the original record: https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l2-sr/items/LC08_L2SP_006022_20210802_20210811_02_T1_SR

but the projected geometry shown in the UI is incorrect as is what is stored in the metadata column in agdc.dataset as per the screenshot below, so it is an error in the indexing, not in cubedash:

"geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          2994762,
          6953579
        ],
        [
          3066327,
          6755450
        ],
        [
          3258331,
          6823158
        ],
        [
          3184804,
          7024432
        ],
        [
          2994762,
          6953579
        ]
      ]
    ]
  }

This puts the tile over near Ireland when it should be on the coast of Quebec.

Just for reference this is a "correct" tile for the same region: https://explorer.eail.easi-eo.solutions/products/landsat8_c2l2_sr/datasets/f3eaa38d-b383-53e0-8baa-1e3be970c10c

And the record directly from agdc.dataset: image

dunkgray commented 1 year ago

@omad what is the data field that has 'Multipolygons instead of simple Polygons'? What process is this generated in?