Thanks Trent, I tried it out:

original:                          3.886.894.126b
compressed DEFLATE:    266.046.034b
compressed LZW:             372.085.756b
compressed JPEG:             90.055.344b

Although DEFLATE and LZW give very good results, JPEG compression is so much better that I need to go for it. The base raster is the cadastral map of Amsterdam in 1832 with a resolution of 30 cm. This is only the low-resolution scan, the base scan has a resolution of 15 cm, slightly better than Google Satellite. We are trying to set things up for the whole of the Netherlands, and with this sort of precision even a small country generates an awful lot of raster scans, and needs unbelievable amounts of processing, even with the Cloud system we have available now.

That means, I'll have to clip the maps. It can be done as Dmitry suggested (gdalwarp -cutline), or alternatively using gdal-rasterize. I do have the bounding polygons. It can also be done with nearblack, as Even suggested. I guess the last method will take somewhat more time, as the area of the map has to be computed.

Thanks for all your suggestions, they made me see where the problem lies. And a happy New Year to all.

Jan

On 12/27/2012 05:18 PM, Hare, Trent wrote:
Jan,
Jpeg is a lossy compression and thus the collar will not be maintained perfectly as black (or 0). You will not get as much compression, but you can try a lossless method like LZW or Packbits. If you are getting close to the 4GB limit you might need to add "-co bigtiff=if_safer".

Good luck,
Trent



On Thu, Dec 27, 2012 at 5:38 AM, Jan Hartmann <j.l.h.hartm...@uva.nl <mailto:j.l.h.hartm...@uva.nl>> wrote:

    Can anyone tell me wath is happening here? I have a large
    three-band raster (3.8G) looking like this:

    http://mapserver.sara.nl/map2a.png

    I compress it (from information from this list a few days ago) with:

    gdal_translate -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR big.tif
    small.tif
    gdaladdo --config COMPRESS_OVERVIEW JPEG --config
    PHOTOMETRIC_OVERVIEW YCBCR -ro -r gauss small.tif 2 4 8 16 32 64

    and get a file of 37M, which is nice. However, the map has all
    kinds of rubbish at the borders. It looks like this:

    http://mapserver.sara.nl/map2b.png

    The equivalent pictures of a small part of the map look like this:

    http://mapserver.sara.nl/map1a.png
    http://mapserver.sara.nl/map1b.png

    Can anyone help me?

    Jan

    _______________________________________________
    gdal-dev mailing list
    gdal-dev@lists.osgeo.org <mailto:gdal-dev@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/gdal-dev



_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to