geotiff.js
geotiff.js copied to clipboard
Resampling Data Methodology - Issue
I'm beginning to notice a lot of discrepancies within the resampling method. For instance, image 1:
You can almost clearly see the tile borders (they are 256 x 256 tiles). I was expecting a smoother transition between tiles, but that does not seem to be occurring. It's very jagged in nature. Does geotiff use the tile borders or does it zoom out interpolate and then zoom back in (could possibly allow for a smoother transition and look more seamless)?
I'm also getting another issue (tiles filled with NaN) when you zoom WAY in. The expected outcome is to continue showing a solid color. Again, depending on how geotiff is currently handling the above will affect this. What is happening is that the values are outside of the tile (I believe). So, what should happen is it geotiff should zoom out, get data points, and then zoom back in on that tile as it will then have values.
Here is a link to the geotiff that I am using to get these results (if helpful). https://www.dropbox.com/s/794hptxorylh78s/hsr_test.tif?dl=0
Please let me know your thoughts/suggestions - if this is an issue with the core geotiff, etc.
Hi, @Craytor . Thanks for posting this issue. Would you happen to be able to share what library you are using to visualize the geotiffs on a map?
@DanielJDufour Most certainly. I've actually got a couple of things going on. I have a nodejs tile server (https://github.com/wxdataio/tile-server/blob/master/routes/test.js) which is creating the tiles from bbox's from the z/x/y from MapBox GL.
I wanted to note that I was looking through some other repos/projects and have noticed similar scenarios.
For instance: https://viymak.github.io/starry-night/ - you can "see" the tiles (not the outlines, but the methodology for zooming in) and also the issue when you zoom in far. app.geotiff.io is also affected by these tiling issues.




Please let me know your thoughts and if you think this is something that this repo should address. I'd also be willing to further discuss/help fix the issue (though I'm not sure how to get started, but know what "should" happen to fix the issue).
Hi @Craytor
You can almost clearly see the tile borders (they are 256 x 256 tiles). I was expecting a smoother transition between tiles, but that does not seem to be occurring. It's very jagged in nature. Does geotiff use the tile borders or does it zoom out interpolate and then zoom back in (could possibly allow for a smoother transition and look more seamless)?
Seeing the first image, I'd assume, that the underlying data does not seem to fit, or is incorrectly cropped or scaled. Can you perhaps try it with other GIS software, like QGIS?
I'm also getting another issue (tiles filled with NaN) when you zoom WAY in. The expected outcome is to continue showing a solid color. Again, depending on how geotiff is currently handling the above will affect this. What is happening is that the values are outside of the tile (I believe). So, what should happen is it geotiff should zoom out, get data points, and then zoom back in on that tile as it will then have values.
The resampling code in geotiff.js is definitely not perfect and can be improved to suit such cases. The resampling code as is, is more suited to the general use case.
For me it is unclear whether the issue is with the resampling code or with the code using it.
@constantinius I have done some more testing and opening in QGIS produces expected output.