-
Notifications
You must be signed in to change notification settings - Fork 44
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
change how blocksize is defined in create CLI #283
change how blocksize is defined in create CLI #283
Conversation
@alexismanin let me know if you can 👀 this PR 🙏 |
"GDAL_TIFF_OVR_BLOCKSIZE env or 128)", | ||
show_default=True, | ||
help="Overview's internal tile size (default can be defined by " | ||
"GDAL_TIFF_OVR_BLOCKSIZE env). The default is 128, or starting with GDAL 3.1 to use the same block size as the full-resolution dataset if possible).", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove default in the CLI
rio_cogeo/scripts/cli.py
Outdated
tilematrixset.matrix(tilematrixset.minzoom).tileHeight, | ||
tilematrixset.matrix(tilematrixset.minzoom).tileWidth, | ||
) | ||
overview_blocksize = overview_blocksize or blocksize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- use TMS tileHeight or tileWidth if
blocksize
is not provided - overview blocksize default to
blocksize
if not provided (only when there is a tilematrixset option)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tilematrix.matrix(tilematrixset.minzoom)
gives the lowest-resolution matrix, whereas tilematrix.matrix(tilematrixset.minzoom)
returns the best level of details. Therefore, I would tend to define blocksize using tilematrix.matrix(tilematrixset.maxzoom)
, and keep the minzoom
one for overview block size.
Now, I am not sure it matters in practice, because I have not seen any tile-matrix set changing tile size between levels (and in such case, looking at only the min and max level would not be enough anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most TMS should have the same tileHeight and tileWidth at all level (at least for the common grids), ideally we would select the blocksize for the zoom level the data cover but we can't get this in the CLI
raster_path_gcps, | ||
], | ||
) | ||
def test_cogeo_info(src_path, runner): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this PR main goal
I will give a quick look at it. |
click.secho( | ||
f"Defining `blocksize` from {tilematrixset.id} TileMatrixSet `tileWidth` and `tileHeight`", | ||
fg="yellow", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only print a warning if blocksize wasn't defined
f"Defining overview's `blocksize` to match the high resolution `blocksize`: {blocksize}", | ||
fg="yellow", | ||
) | ||
overview_blocksize = blocksize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
ref #279 (review)
closes #280