-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
gdal2tiles too slow while add transparent parameter. #11302
Comments
Without the |
I suppose that your source data is somehow special. My test with a 12000x12000 RGB image took about 210 seconds to run with and without |
@jratike80 |
@jratike80 do you received the testing data? |
I do not see such mail on the list https://lists.osgeo.org/pipermail/gdal-dev/2024-November/date.html. |
I have received your test data and I can confirm, that adding |
I believe that the reason for the slowliness in this case comes from gdal2tiles reading the nodata always from the full resolution data.
Here are some commands for testing if my theory is correct. Create a 50000x50000 sized image filled with zeroes.
Run gdal2tiles command for the image. This is slow because there are no overviews so gdal2tiles must read the full resolution data. This took about 20 minutes on my computer. I did not test how gdal2tiles behaves without setting the fized zoom level but I think that there should be no speed difference in creating the base tiles because the full resolution data is read in both cases. If the next zoom levels with bigger pixel size are constructed from the previous tiles there should be no speed difference either. So maybe the issue is restricted to the use case when gdal2tiles is asked to create subsampled zoom level directly from the source data. I am not sure if it would be safe to read also the nodata from the overviews. Overviews can be resampled with methods like average or cubic and compressed with lossy methods like JPEG and the nodata mask may not be accurate any more. But if user wants to get z12 directly from data with a native resolution that is close to z20 the accuracy is probably not the main goal. |
Two more tests. Source file has no overviews and no nodata set into the metadata. Gdal2tiles is run without
It looks like gdal2tiles really needs to do 50% more work when it has to find out the nodata pixels. I cannot say if that is something that could be avoided with more clever coding. I fear I have reached my limits with analysing this issue now. |
I encountered a phenomenon during my actual operations that I’d like to report: after setting the a nested vrt like this
|
What is the bug?
During the use of gdal2tiles, I encountered a few issues:
the snapshot source image
after set nodata value
the vrt file info
Steps to reproduce the issue
just add -a 0 to gdal2tiles parameter.
Versions and provenance
gdalversion: 3.10.0
Additional context
No response
The text was updated successfully, but these errors were encountered: