-
Notifications
You must be signed in to change notification settings - Fork 42
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
[READY] Web optimized #40
Conversation
vrt_transform = Affine(vrt_res, 0, w, 0, -vrt_res, n) | ||
|
||
vrt_width = (extrema["x"]["max"] - extrema["x"]["min"]) * 256 | ||
vrt_height = (extrema["y"]["max"] - extrema["y"]["min"]) * 256 |
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.
👆 this need to be validated (@dnomadb 😄 ?)
|
||
# TODO: What does this means when alpha is passed ? | ||
if utils.has_alpha_band(src): | ||
vrt_params.update(dict(add_alpha=False)) |
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.
#38 this is going to change a lot of the logic, I'll open another ticket to speak about mask/alpha/nodata IN/OUT options
rio_cogeo/utils.py
Outdated
|
||
|
||
def get_max_zoom(src, snap=0.5, max_z=23): | ||
"""Calculate raster max zoom level.""" |
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.
Need docs and tests
def test_cogeo_valid_external_mask(monkeypatch): | ||
"""Should work as expected.""" | ||
monkeypatch.setenv("GDAL_TIFF_INTERNAL_MASK", "FALSE") | ||
monkeypatch.setenv("GDAL_DISABLE_READDIR_ON_OPEN", "FALSE") |
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.
I had GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR
set in my end, so gdal/rasterio wasn't able to find the .msk
file. This change is unrelated to the PR but make sure it will work on any system. I could remove it if needed.
|
||
# loop through the pyramid to file the closest z level | ||
for z in range(1, max_z): | ||
mpp = _meters_per_pixel(z, 0) |
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 should maybe take latitude into account here
@sgillies @perrygeo this is ready to review. That's said there is still some open question we need to answer:
|
replaces #22
resolves #10
@perrygeo @sgillies this is almost the same code as in #22 but I've cut the commits in part to make it clearer. I've added comment in the PR to help.
Basically this PR introduce a
--web
option to create a COG aligned with the web mercator grid. To do so we need to useWarpedVRT
which change the structure of the code (see: 5da9cdf)