[gdal-dev] strange behaviour with gdalwarp and LZW compression

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] strange behaviour with gdalwarp and LZW compression

Stefano Iacovella
Hello all

I'm using gdal utilities to georeference some tiff files.

I'm inserting the gcp using:

 gdal_translate -gcp ....  original.tif original_gcp.tif

Then I use gdalwarp to gereference the images:

 gdalwarp -t_srs EPSG:32633 original_gcp.tif original_warp.tif

The resulting Geotiff is correctly georeferenced and the size is
approximately the same of the original

The problem arise if I insert the options -co COMPRESS=LZW at the
warping. The process end successfully but the resulting geotiff is 6
times the size of the original one!

I've tried to use:

gdal_translate -of GTIFF -co COMPRESS=LZW original_warp.tif
original_warp_lzw.tif

and it produces a geotiff smaller than the original.

Am I doing something incorrect?

thank you in advance

Stefano
---------------------------------------------------
41.95581N 12.52854E


http://www.linkedin.com/in/stefanoiacovella

http://twitter.com/#!/Iacovellas
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Re: strange behaviour with gdalwarp and LZW compression

Stefano Iacovella
Sorry

I forgot to say I'm using GDAL 1.9.0 compiled on ubuntu 10.04

2012/3/7 Stefano Iacovella <[hidden email]>:

> Hello all
>
> I'm using gdal utilities to georeference some tiff files.
>
> I'm inserting the gcp using:
>
>  gdal_translate -gcp ....  original.tif original_gcp.tif
>
> Then I use gdalwarp to gereference the images:
>
>  gdalwarp -t_srs EPSG:32633 original_gcp.tif original_warp.tif
>
> The resulting Geotiff is correctly georeferenced and the size is
> approximately the same of the original
>
> The problem arise if I insert the options -co COMPRESS=LZW at the
> warping. The process end successfully but the resulting geotiff is 6
> times the size of the original one!
>
> I've tried to use:
>
> gdal_translate -of GTIFF -co COMPRESS=LZW original_warp.tif
> original_warp_lzw.tif
>
> and it produces a geotiff smaller than the original.
>
> Am I doing something incorrect?
>
> thank you in advance
>
> Stefano
> ---------------------------------------------------
> 41.95581N 12.52854E
>
>
> http://www.linkedin.com/in/stefanoiacovella
>
> http://twitter.com/#!/Iacovellas
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange behaviour with gdalwarp and LZW compression

Eli Adam
Stefano,

      I think that is expected.  You can read a little more about it
and a recommended work around (VRT) here,
http://trac.osgeo.org/gdal/wiki/UserDocs/GdalWarp#GeoTIFFoutput-coCOMPRESSisbroken

Bests, Eli

>> The problem arise if I insert the options -co COMPRESS=LZW at the
>> warping. The process end successfully but the resulting geotiff is 6
>> times the size of the original one!
>>
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange behaviour with gdalwarp and LZW compression

Eli Adam
Reading further, I learn about OPTIMIZE_SIZE,
http://gdal.org/structGDALWarpOptions.html#a0ed77f9917bb96c7a9aabd73d4d06e08

Can OPTIMIZE_SIZE be set from the command line?

Eli

On Tue, Mar 6, 2012 at 3:41 PM, Eli Adam <[hidden email]> wrote:

> Stefano,
>
>      I think that is expected.  You can read a little more about it
> and a recommended work around (VRT) here,
> http://trac.osgeo.org/gdal/wiki/UserDocs/GdalWarp#GeoTIFFoutput-coCOMPRESSisbroken
>
> Bests, Eli
>
>>> The problem arise if I insert the options -co COMPRESS=LZW at the
>>> warping. The process end successfully but the resulting geotiff is 6
>>> times the size of the original one!
>>>
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange behaviour with gdalwarp and LZW compression

Even Rouault
Le mercredi 07 mars 2012 00:48:39, Eli Adam a écrit :
> Reading further, I learn about OPTIMIZE_SIZE,
> http://gdal.org/structGDALWarpOptions.html#a0ed77f9917bb96c7a9aabd73d4d06e0
> 8
>
> Can OPTIMIZE_SIZE be set from the command line?

Yes, this is a Warping Option, so you can specify it with the -wo
OPTIMIZE_SIZE=YES option

>
> Eli
>
> On Tue, Mar 6, 2012 at 3:41 PM, Eli Adam <[hidden email]> wrote:
> > Stefano,
> >
> >      I think that is expected.  You can read a little more about it
> > and a recommended work around (VRT) here,
> > http://trac.osgeo.org/gdal/wiki/UserDocs/GdalWarp#GeoTIFFoutput-coCOMPRES
> > Sisbroken
> >
> > Bests, Eli
> >
> >>> The problem arise if I insert the options -co COMPRESS=LZW at the
> >>> warping. The process end successfully but the resulting geotiff is 6
> >>> times the size of the original one!
>
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: strange behaviour with gdalwarp and LZW compression

Stefano Iacovella
Eli, Even

thanks a lot both of you

I tried with options

-wo OPTIMIZE_SIZE=YES -of GTIFF -co COMPRESS=LZW

and it works perfectly

Have a nice day

Stefano

2012/3/7 Even Rouault <[hidden email]>:

> Le mercredi 07 mars 2012 00:48:39, Eli Adam a écrit :
>> Reading further, I learn about OPTIMIZE_SIZE,
>> http://gdal.org/structGDALWarpOptions.html#a0ed77f9917bb96c7a9aabd73d4d06e0
>> 8
>>
>> Can OPTIMIZE_SIZE be set from the command line?
>
> Yes, this is a Warping Option, so you can specify it with the -wo
> OPTIMIZE_SIZE=YES option
>
>>
>> Eli
>>
>> On Tue, Mar 6, 2012 at 3:41 PM, Eli Adam <[hidden email]> wrote:
>> > Stefano,
>> >
>> >      I think that is expected.  You can read a little more about it
>> > and a recommended work around (VRT) here,
>> > http://trac.osgeo.org/gdal/wiki/UserDocs/GdalWarp#GeoTIFFoutput-coCOMPRES
>> > Sisbroken
>> >
>> > Bests, Eli
>> >
>> >>> The problem arise if I insert the options -co COMPRESS=LZW at the
>> >>> warping. The process end successfully but the resulting geotiff is 6
>> >>> times the size of the original one!
>>
>> _______________________________________________
>> gdal-dev mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev