[gdal-dev] Problem with black edges to DOQQs using JPEG in Tiff compression

Stephen Woodbridge woodbri at swoodbridge.com
Mon Feb 13 07:14:44 PST 2017

Jukka, Thanks for your suggestion. We have a couple of requirements 
mapserver is only one, the other is some additional processing, but I 
like the simplicity of your suggestion.

Brian C. spend a lot of time on irc with me and I think we finally got 
the processing chain straightened out and it looks like:

# first preclip any collar (probably not needed)
nearblack -co TILED=YES -of GTiff -nb 0 -near 0 -setmask -q -o tmpfile1 

gdalwarp -t_srs EPSG:4326 -dstalpha -co TILED=YES tmpfile1 tmpfile2

gdal_translate -co TILED=YES -co JPEG_QUALITY=90 -co COMPRESS=JPEG -co 
PHOTOMETRIC=YCBCR -b 1 -b 2 -b 3 -mask 4 --config 

gdaladdo -clean -r bilinear target 2 4 8 16 32 64 128

This is pretty fast taking about 9-10 sec per doqq to process.

Thank you for all the suggestions and help.


On 2/13/2017 5:02 AM, jratike80 wrote:
> Stephen Woodbridge wrote
>> Even,
>> Thanks for the quick feedback. I'll will give these suggestions and try
>> today and let you know how it goes.
>> Thanks,
>>    -Steve
> Hi Steve,
> They are probably good suggestions but folks did not bother to think what is
> your ultimate target. It is not to improve you commands and hide the black
> pixels but simply to make a jpeg-in-tiff compressed mosaic without seams for
> Mapserver, perhaps following some other route if it is easier.
> So, my suggestion is:
> 1) Skip gdalwarp
> 2) Compress your images in native projection
> 3) Create jpeg compressed overviews
> 4) Create tileindex and utilize the super powerful "Tileindexes with tiles
> in different projections" feature
> http://www.mapserver.org/optimization/tileindex.html
> You did not mention if your DOQQs come in several different projections but
> I suppose that they do. Otherwise there is even less point to use gdalwarp,
> Mapserver is so fast with on-the-fly re-projecting.
> -Jukka Rahkonen-
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Problem-with-black-edges-to-DOQQs-using-JPEG-in-Tiff-compression-tp5307551p5307662.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

This email has been checked for viruses by Avast antivirus software.

More information about the gdal-dev mailing list