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

◆ calculate_overview_factor()

raster2pgsql.calculate_overview_factor (   ds,
  overview 
)

Definition at line 499 of file raster2pgsql.py.

499def calculate_overview_factor(ds, overview):
500 assert ds is not None
501
502
503 # Assume all bands have same layout of overviews
504 band = ds.GetRasterBand(1)
505 assert band is not None
506 assert overview < band.GetOverviewCount()
507
508 ov_band = band.GetOverview(overview)
509 assert ov_band is not None
510
511 ovf = int(0.5 + ds.RasterXSize / float(ov_band.XSize))
512 logit('MSG: Overview factor = %d\n' % ovf)
513
514 return ovf
515
516