Skip to content

Unnecessary Resampling leading to poor pixel positioning #30

@staffordsmith83

Description

@staffordsmith83

Dear Hongfaqiou,

there seems to be an issue with how TIFFImageryProvider maps the tiff values to the canvas. This occurs even when re-projection is not needed, e.g. for cogs in EPSG:4326 and EPSG:3857.

Using this Climate Data cog as an example (it is in EPSG:4326): https://nex-gddp-cmip6-cog.s3-us-west-2.amazonaws.com/daily/GFDL-CM4/ssp585/r1i1p1f1/pr/pr_day_GFDL-CM4_ssp585_r1i1p1f1_gr1_2015_01_25.tif

The data should look like this:
image

But TIFFImageryProvider renders it like this:
image

Note the following:

  • The pixels are no longer square and appear to be resampled
  • It does not retain the data integrity - we need users to be able to see the value of this scientific data at a single point on the globe.

Note in a more zoomed in example, how the pixels are clearly not square. This is TIFFImageryProvider in TerriaJS:
image

This is TIFFImageryProvider in your online demo:
image

Whereas the tru data is square pixels (shown in QGIS):
image

Please note, to be able to see what is happening at the pixel level we have changed the Cesium settings for _defaultMagnificationFilter and _defaultMinificationFilter to remove the blurring:
https://github.com/TerriaJS/terriajs/blob/13fa4cfaabecdc82dff749836a1dcef602b0a1ae/lib/Models/Catalog/CatalogItems/CogCatalogItem.ts#L140-L141

If you like, we have put more details on the perceived error in out PR here: TerriaJS/terriajs#7209

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions