PostGIS  2.3.8dev-r@@SVN_REVISION@@
rtrowdump Namespace Reference

Functions

def logit (msg)
 
def pt2gdt (pt)
 
def pt2numpy (pt)
 

Variables

 prs
 
 dest
 
 action
 
 default
 
 help
 
 opts
 
 args
 
 VERBOSE = opts.verbose
 
 rt = rtreader.RasterReader(opts.db, opts.table, opts.column, opts.where)
 
 logging
 
string out_format = "GTiff"
 
 out_driver = gdal.GetDriverByName(out_format)
 
def out_data_type = pt2gdt(rt.pixel_types[0])
 
 out_ds = out_driver.Create(opts.output, rt.width, rt.height, rt.num_bands, out_data_type)
 
 raster = numpy.zeros((rt.height, rt.width), pt2numpy(out_data_type))
 Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): http://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html?highlight=zeros#numpy.zeros. More...
 
 pixel = rt.get_value(b, width_index + 1, height_index + 1)
 
 band = out_ds.GetRasterBand(b)