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

◆ calculate_overview_factor()

raster2pgsql.calculate_overview_factor (   ds,
  overview 
)

Definition at line 500 of file raster2pgsql.py.

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