| | 383 | # Verify we can grow the RRD list in cases where this requires |
|---|
| | 384 | # moving the HFAEntry to the end of the file. (bug #1109) |
|---|
| | 385 | |
|---|
| | 386 | def hfa_grow_rrdlist(): |
|---|
| | 387 | |
|---|
| | 388 | # copy work file to tmp directory. |
|---|
| | 389 | open('tmp/bug_1109.img','w').write(open('data/bug_1109.img').read()) |
|---|
| | 390 | |
|---|
| | 391 | # Add two overview levels. |
|---|
| | 392 | ds = gdal.Open('tmp/bug_1109.img',gdal.GA_Update) |
|---|
| | 393 | result = ds.BuildOverviews( overviewlist = [4,8] ) |
|---|
| | 394 | ds = None |
|---|
| | 395 | |
|---|
| | 396 | if result != 0: |
|---|
| | 397 | gdaltest.post_reason( 'BuildOverviews failed.' ) |
|---|
| | 398 | return 'fail' |
|---|
| | 399 | |
|---|
| | 400 | # Verify overviews are now findable. |
|---|
| | 401 | ds = gdal.Open( 'tmp/bug_1109.img' ) |
|---|
| | 402 | if ds.GetRasterBand(1).GetOverviewCount() != 3: |
|---|
| | 403 | gdaltest.post_reason( 'Overview count wrong.' ) |
|---|
| | 404 | print ds.GetRasterBand(1).GetOverviewCount() |
|---|
| | 405 | return 'fail' |
|---|
| | 406 | |
|---|
| | 407 | ds = None |
|---|
| | 408 | gdal.GetDriverByName('HFA').Delete( 'tmp/bug_1109.img' ) |
|---|
| | 409 | |
|---|
| | 410 | return 'success' |
|---|
| | 411 | |
|---|
| | 412 | ############################################################################### |
|---|