PostGIS  2.1.10dev-r@@SVN_REVISION@@
def raster2pgsql.calculate_block_size (   ds,
  band_from,
  band_to 
)
Size of natural block reported by GDAL for bands of given dataset

Definition at line 543 of file raster2pgsql.py.

References logit().

543 def calculate_block_size(ds, band_from, band_to):
544  """Size of natural block reported by GDAL for bands of given dataset"""
545 
546  block_dims = None
547  for i in range(band_from, band_to):
548  band = ds.GetRasterBand(i)
549  assert band is not None, "Cannot access raster band %d" % i
550  dims = band.GetBlockSize()
551 
552  # Assume bands with common block size
553  if i == band_from:
554  block_dims = dims
555 
556  # Validate dimensions of bands block
557  if block_dims != dims:
558  logit("MSG: Block sizes don't match: %s != %s\n" % (str(block_dims), str(dims)))
559 
560  assert block_dims is not None, "Failed to calculate block size"
561  return (int(block_dims[0]), int(block_dims[1]))
562 
def calculate_block_size(ds, band_from, band_to)
def logit(msg)

Here is the call graph for this function: