PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ calculate_overviews()

raster2pgsql.calculate_overviews (   ds,
  band_from = None,
  band_to = None 
)

RASTER OPERATIONS.

Definition at line 487 of file raster2pgsql.py.

487def calculate_overviews(ds, band_from = None, band_to = None):
488 assert ds is not None
489
490 if band_from is None:
491 band_from = 0
492 if band_to is None:
493 band_to = ds.RasterCount
494
495 assert band_to <= ds.RasterCount,'Failed checking band_to=%d <= RasterCount=%d' % (band_to,ds.RasterCount)
496 assert band_from <= band_to
497
498 nov = 0
499 for i in range(band_from, band_to + 1):
500 n = ds.GetRasterBand(i).GetOverviewCount()
501 if 0 == nov:
502 nov = n
503 assert n == nov, 'Number of raster overviews is not the same for all bands'
504
505 return nov
506