-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
gdal raster tile: speed-up generation of (max zoom) tiles in PNG format #12731
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
base: master
Are you sure you want to change the base?
Conversation
e7d8db5
to
9799382
Compare
f1b7859
to
f45dbde
Compare
f45dbde
to
8d6972f
Compare
FYI @jcphill |
It looks like if a highest-zoom tile is all one color it is drawn as black, although there are a few other examples where the highest-level tile is black but should be different colors. It is possible that there is one channel that is zero for the entire tile. |
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'm guessing I was seeing the black boxes because the blue channel was zero and it was being read as the alpha channel.
By using an optimized code path, one can speed by 36% in some cases tile generation, when using libdeflate. If using zlib only, the gain is more modest, but still there. e.g using https://nz-imagery.s3-ap-southeast-2.amazonaws.com/otago/otago_2025_0.2m/rgb/2193/CA14_5000_0304.tiff Before: ``` $ time GDAL_RASTER_TILE_USE_PNG_OPTIM=NO gdal raster tile CA14_5000_0304.tiff CA14_5000_0304_tiled --progress 0...10...20...30...40...50...60...70...80...90...100 - done in 00:00:12. real 0m13,234s user 2m14,696s sys 0m2,220s Size of output directory: 373.356 MB ``` After: ``` $ time gdal raster tile CA14_5000_0304.tiff CA14_5000_0304_tiled --progress 0...10...20...30...40...50...60...70...80...90...100 - done in 00:00:08. real 0m8,352s user 1m26,253s sys 0m1,929s Size of output directory: 359.384 MB ```
8d6972f
to
a99f508
Compare
The tile problem is fixed and the runtime is down to 11:10 now, so 17% overall improvement. |
The max zoom tile png files are 5% or so larger, though. |
By using an optimized code path, one can speed by 36% in some cases tile generation, when using libdeflate. If using zlib only, the gain is more modest, but still there.
e.g using https://nz-imagery.s3-ap-southeast-2.amazonaws.com/otago/otago_2025_0.2m/rgb/2193/CA14_5000_0304.tiff
Before:
After: