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

◆ calculate_overview_factor()

raster2pgsql.calculate_overview_factor (   ds,
  overview 
)

Definition at line 507 of file raster2pgsql.py.

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