[Gdal-dev] GDAL_warp output image sizes vary.... Why?

Sampson, David dsampson at NRCan.gc.ca
Tue Dec 19 17:23:50 EST 2006


Hey folks

I am batching the georef of a bunch of images and find GREAT variances
between input and output file sizes....

As the input file size is pretty consistent, and the same X,Y points are
used for GCP's in each image and the outsize option is set for 67%  I
would expect a consisent drop in file sizes.

Why is this not the case? Why do the gdal_warp images maintain their
appropriate file sizes?  And how can I add this condition in?

Note. Images start off as 32 bit and end off at 16bit (there is a 50%
drop already).

I have had cases where the output file is as large as 50 MEGS.... 

Why would the output file be larger than the intermediate file?

Anyone explain this?


This is a sample script

gdal_translate -gcp  12981.31  12074.39 -74.002213  45.584502 -gcp
1248.85  12074.39 -73.976008  45.594211 -gcp  1238.96  341.61 -73.95824
45.570552 -gcp  12981.31  341.61 -73.984438  45.560847 -scale  -ot byte
-outsize  67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area"
A74_001.tif .\work\iA74_001.tif
gdalwarp -t_srs epsg:4326 .\work\iA74_001.tif .\output\oA74_1.tif
gdal_translate -gcp  12981.31  12074.39 -74.020358  45.578035 -gcp
1248.85  12074.39 -73.993978  45.587504 -gcp  1238.96  341.61 -73.976652
45.563685 -gcp  12981.31  341.61 -74.003023  45.55422 -scale  -ot byte
-outsize  67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area"
A74_003.tif .\work\iA74_003.tif
gdalwarp -t_srs epsg:4326 .\work\iA74_003.tif .\output\oA74_3.tif
gdal_translate -gcp  12981.31  12074.39 -74.036225  45.579734 -gcp
1248.85  12074.39 -74.007057  45.583378 -gcp  1238.96  341.61 -74.000396
45.557043 -gcp  12981.31  341.61 -74.029551  45.553401 -scale  -ot byte
-outsize  67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area"
A74_004.tif .\work\iA74_004.tif
gdalwarp -t_srs epsg:4326 .\work\iA74_004.tif .\output\oA74_4.tif
gdal_translate -gcp  12981.31  12074.39 -74.044881  45.581698 -gcp
1248.85  12074.39 -74.015255  45.581771 -gcp  1238.96  341.61 -74.01513
45.555024 -gcp  12981.31  341.61 -74.044742  45.554951 -scale  -ot byte
-outsize  67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area"
A74_005.tif .\work\iA74_005.tif
gdalwarp -t_srs epsg:4326 .\work\iA74_005.tif .\output\oA74_5.tif
gdal_translate -gcp  12981.31  12074.39 -74.06504  45.585733 -gcp
1248.85  12074.39 -74.035766  45.582529 -gcp  1238.96  341.61 -74.041636
45.556102 -gcp  12981.31  341.61 -74.070897  45.559304 -scale  -ot byte
-outsize  67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area"
A74_007.tif .\work\iA74_007.tif
gdalwarp -t_srs epsg:4326 .\work\iA74_007.tif .\output\oA74_7.tif
gdal_translate -gcp  12981.31  12074.39 -74.08218  45.58133 -gcp
1248.85  12074.39 -74.052898  45.584496 -gcp  1238.96  341.61 -74.04711
45.55806 -gcp  12981.31  341.61 -74.076378  45.554894 -scale  -ot byte
-outsize  67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area"
A74_008.tif .\work\iA74_008.tif
gdalwarp -t_srs epsg:4326 .\work\iA74_008.tif .\output\oA74_8.tif
gdal_translate -gcp  12981.31  12074.39 -74.091197  45.582613 -gcp
1248.85  12074.39 -74.061579  45.583126 -gcp  1238.96  341.61 -74.060646
45.556387 -gcp  12981.31  341.61 -74.09025  45.555874 -scale  -ot byte
-outsize  67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area"
A74_009.tif .\work\iA74_009.tif
gdalwarp -t_srs epsg:4326 .\work\iA74_009.tif .\output\oA74_9.tif
gdal_translate -gcp  12981.31  12074.39 -74.102078  45.582808 -gcp
1248.85  12074.39 -74.072451  45.582883 -gcp  1238.96  341.61 -74.072321
45.556136 -gcp  12981.31  341.61 -74.101934  45.556061 -scale  -ot byte
-outsize  67%% 67%% -a_srs epsg:4326 -mo "Area_or_Point = Area"
A74_010.tif .\work\iA74_010.tif
gdalwarp -t_srs epsg:4326 .\work\iA74_010.tif .\output\oA74_10.tif
rmdir /S /Q work
rmdir work



This is a snapshot of input file sizes:
98,402,364 A74_001.tif
98,402,364 A74_003.tif
98,402,364 A74_004.tif
98,402,364 A74_005.tif
98,402,364 A74_006.tif
98,402,364 A74_007.tif
98,402,364 A74_008.tif
98,402,364 A74_009.tif
98,402,364 A74_010.tif


Here is a snapshot of intermediate files sizes.
22,166,568 iA74_001.tif
22,166,568 iA74_003.tif
22,166,568 iA74_004.tif
22,166,568 iA74_005.tif
22,166,568 iA74_007.tif
22,166,568 iA74_008.tif
22,166,568 iA74_009.tif
22,166,568 iA74_010.tif


This is a snapshot of output filesizes.
31,590,866 oA74_1.tif
22,688,710 oA74_10.tif
31,528,630 oA74_3.tif
27,565,240 oA74_4.tif
22,693,186 oA74_5.tif
33,634,388 oA74_7.tif
27,024,772 oA74_8.tif
23,396,196 oA74_9.tif


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20061219/f3bff930/attachment.html


More information about the Gdal-dev mailing list