Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maybe mistake in xy offset in error message #471

Closed
tsjsdbd opened this issue Dec 20, 2021 · 4 comments
Closed

maybe mistake in xy offset in error message #471

tsjsdbd opened this issue Dec 20, 2021 · 4 comments

Comments

@tsjsdbd
Copy link

tsjsdbd commented Dec 20, 2021

when File broken, the error message maybe have mistake:

Read or write failed. IReadBlock failed at X offset 7, Y offset 28: /tmp/200504_08_83807.tif, band 1: IReadBlock failed at X offset 7, Y offset 7: TIFFReadEncodedTile() failed.

you can see, when error occur, the error message is not consistent. xy=[7,28] , xy=[7,7]

@vincentsarago
Copy link
Member

The error message comes from Rasterio/GDAL, nothing to do with rio-tiler. Sorry

@tsjsdbd
Copy link
Author

tsjsdbd commented Dec 21, 2021

@vincentsarago
A digression. Can we organize COG-TIFF tiles according to the size projected by Mercator, so that tiles are not crossed each time they are fetched. In this way, only the smallest HTTP request needs to be sent.
image
from here

@vincentsarago
Copy link
Member

@tsjsdbd you need to create a web-optimized COG, meaning you need to have the data and the overview aligned with the WebMercator grid
see https://gdal.org/drivers/raster/cog.html#reprojection-related-creation-options

TILING_SCHEME=CUSTOM/GoogleMapsCompatible/other: Default value: CUSTOM. If set to a value different than CUSTOM, the definition of the specified tiling scheme will be used to reproject the dataset to its CRS, select the resolution corresponding to the closest zoom level and align on tile boundaries at this resolution. The tile size indicated in the tiling scheme definition (generally 256 pixels) will be used, unless the user has specified a value with the BLOCKSIZE creation option, in which case the user specified one will be taken into account (that is if setting a higher value than 256, the original tiling scheme is modified to take into account the size of the HiDPi tiles). In non-CUSTOM mode, TARGET_SRS, RES and EXTENT options are ignored. Starting with GDAL 3.2, the value of TILING_SCHEME can also be the filename of a JSON file according to the OGC Two Dimensional Tile Matrix Set standard, a URL to such file, the radical of a definition file in the GDAL data directory (e.g. FOO for a file named tms_FOO.json) or the inline JSON definition.

or https://cogeotiff.github.io/rio-cogeo/Advanced/#web-optimized-cog

@tsjsdbd
Copy link
Author

tsjsdbd commented Dec 25, 2021

Thank you very much, the performance has been greatly improved.
before:
image
after:
image

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

No branches or pull requests

2 participants