[gdal-dev] Are those 2 things possible using gdal2tiles?

Jorge Arévalo jorge at cartodb.com
Thu Feb 5 10:33:55 PST 2015


Wow, we answered at same time. So, I'll include my findings here

> Even Rouault <mailto:even.rouault at spatialys.com>
> February 5, 2015 at 7:30 PM
> Jorge,
>
>> - Generate JPEG tiles instead of PNG. Tried just replacing the driver's
>> name (PNG) with JPEG. Didn't work. Base tiles are generated, but
>> overview tiles are not. Getting this error instead: ERROR 1: Buffer too
>> small
>
> This messages comes from the WriteRaster() Python bindings, when it is passed
> a buffer that isn't large enough regarding the advertized buffer dimensions.
> Perhaps due to the fact that JPEG only supports 3 bands and PNG 4, although
> this is just a guess without deeper inspection.


The problem is in swig/python/extensions/gdal_wrap.cpp, method 
GDALDatasetShadow_WriteRaster, because Buf len = 196608, min buffer size 
= 262144.

Is there any method to pass a bigger buffer to JPEG driver? Or just 
avoid the 4th band of PNG

>> - Apply a color to nodata value of generated tiles. Tried passing -a
>> "200,0,0" to gdal2tiles, but it was ignored.
>
> The doc of -a suggests that it only applies to the input dataset, not the
> output
Mmmm... ok. Is there a Python method to specify a color for nodata 
pixels when creating an output dataset?


Thanks again, Even!
> Even
>
> Jorge Arévalo <mailto:jorge at cartodb.com>
> February 5, 2015 at 7:15 PM
> - Generate JPEG tiles instead of PNG. Tried just replacing the 
> driver's name (PNG) with JPEG. Didn't work. Base tiles are generated, 
> but overview tiles are not. Getting this error instead: ERROR 1: 
> Buffer too small
> - Apply a color to nodata value of generated tiles. Tried passing -a 
> "200,0,0" to gdal2tiles, but it was ignored.
>
>
> Log file, with GDAL_DEBUG=On, where you can see the first problem 
> (buffer too small): 
> https://dl.dropboxusercontent.com/u/6599273/errors/gdal/gdal2tiles_error.log
> Modified version of gdal2tiles, to generate xyz caches instead of tms 
> ones: 
> https://dl.dropboxusercontent.com/u/6599273/errors/gdal/gdal2tiles_modified.py
> tif tile for testing (same error with other ones): 
> https://dl.dropboxusercontent.com/u/6599273/gis_data/katrina.tif
>
> Many thanks!
>

-- 
Sent with Postbox <http://www.getpostbox.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150205/db6f7d2c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150205/db6f7d2c/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postbox-contact.jpg
Type: image/jpeg
Size: 1187 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150205/db6f7d2c/attachment-0001.jpg>


More information about the gdal-dev mailing list