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

◆ pt2gdt()

rtrowdump.pt2gdt (   pt)
Translate WKT Raster pixel type to GDAL type

Definition at line 39 of file rtrowdump.py.

39def pt2gdt(pt):
40 """Translate WKT Raster pixel type to GDAL type"""
41 pixtypes = {
42 '8BUI' : osgeo.gdalconst.GDT_Byte,
43 '16BSI' : osgeo.gdalconst.GDT_Int16,
44 '16BUI' : osgeo.gdalconst.GDT_UInt16,
45 '32BSI' : osgeo.gdalconst.GDT_Int32,
46 '32BUI' : osgeo.gdalconst.GDT_UInt32,
47 '32BF' : osgeo.gdalconst.GDT_Float32,
48 '64BF' : osgeo.gdalconst.GDT_Float64
49 }
50 if hasattr(osgeo.gdalconst, 'GDT_Float16'):
51 pixtypes['16BF'] = osgeo.gdalconst.GDT_Float16
52 return pixtypes.get(pt, 'UNKNOWN')
53