PostGIS  2.5.0beta1dev-r@@SVN_REVISION@@

◆ rt_util_pixtype_to_gdal_datatype()

GDALDataType rt_util_pixtype_to_gdal_datatype ( rt_pixtype  pt)

Convert rt_pixtype to GDALDataType.

Parameters
pt: pixeltype to convert
Returns
valid GDALDataType

Definition at line 118 of file rt_util.c.

References PT_16BSI, PT_16BUI, PT_1BB, PT_2BUI, PT_32BF, PT_32BSI, PT_32BUI, PT_4BUI, PT_64BF, PT_8BSI, and PT_8BUI.

Referenced by rt_band_load_offline_data(), rt_raster_gdal_rasterize(), rt_raster_gdal_warp(), and rt_raster_to_gdal_mem().

118  {
119  switch (pt) {
120  case PT_1BB:
121  case PT_2BUI:
122  case PT_4BUI:
123  case PT_8BUI:
124  return GDT_Byte;
125  case PT_8BSI:
126  case PT_16BSI:
127  return GDT_Int16;
128  case PT_16BUI:
129  return GDT_UInt16;
130  case PT_32BSI:
131  return GDT_Int32;
132  case PT_32BUI:
133  return GDT_UInt32;
134  case PT_32BF:
135  return GDT_Float32;
136  case PT_64BF:
137  return GDT_Float64;
138  default:
139  return GDT_Unknown;
140  }
141 
142  return GDT_Unknown;
143 }
Here is the caller graph for this function: