Search code examples
openlayers

OpenLayers: can't render two tiff files almost the same


I have created this codesandbox example, in which I render without any style a tiff: https://codesandbox.io/s/cog-test-aspect-kriw38?file=/main.js

image

The tiff source is this https://andy-aws.s3.eu-north-1.amazonaws.com/input.tiff

If I replace it with a very similar tiff (https://andy-aws.s3.eu-north-1.amazonaws.com/sample_dnw_byte.tiff) I have no rendering.

I'm sure it's an error of mine, but I don't understand what it is.

Thank you


Solution

  • The problem is the negative height of the tiles.

    I can read it using:

    source.getView().then(() => {console.log(source.getTileGrid())});
    

    I have regenerated again the source using gdalwarp, and I have now the right dimensions.

    In the source tif, I had wrong pixels size.