junm at comsine.co.uk
Tue Aug 10 11:05:39 EDT 2004
I met some problems when using the Dataset's Method: BuildOverviews.
My aim is to use it for making small image of the original one.
1. Development environment is listed below,
Operation System: WindowsXP
2. Source code:
from math import *
from gdal.gdalconst import *
from gdal.ogr import *
from gdal.osr import *
src_dem = gdal.Open(test.tif) # open the tif file
result = rc_dem.BuildOverviews(resampling="NEAREST" ,overviewlist
= ,callback = callback) # build the overviews
if (result == gdal.CE_Failure):
print "failed to build overviews"
# callback function
def callback(complete, msg, data):
print complete, msg, data
It doesnt work. The result is gdal.CE_Failure. The message returned
by callback function is 0.0 None.
The test data is a Landsat TIF file. I can open the file and read all
the bands, so the file should be okay. Ive tried some other tif
files and varied the parameters: "NEAREST", "AVERAGE", "MODE" and
[2,4,8], [2,4,8,16,32,64]. I got the same result and callback message.
Did any one meet this problem before? Could you please give me some
Thanks a lot.
More information about the Gdal-dev