PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ rt_util_gdal_datatype_to_pixtype()

rt_pixtype rt_util_gdal_datatype_to_pixtype ( GDALDataType  gdt)

Convert GDALDataType to rt_pixtype.

Parameters
gdt: GDAL datatype to convert
Returns
valid rt_pixtype

Definition at line 153 of file rt_util.c.

References PT_16BSI, PT_16BUI, PT_32BF, PT_32BSI, PT_32BUI, PT_64BF, PT_8BUI, and PT_END.

Referenced by convert_raster(), RASTER_addBandOutDB(), and rt_raster_from_gdal_dataset().

153  {
154  switch (gdt) {
155  case GDT_Byte:
156  return PT_8BUI;
157  case GDT_UInt16:
158  return PT_16BUI;
159  case GDT_Int16:
160  return PT_16BSI;
161  case GDT_UInt32:
162  return PT_32BUI;
163  case GDT_Int32:
164  return PT_32BSI;
165  case GDT_Float32:
166  return PT_32BF;
167  case GDT_Float64:
168  return PT_64BF;
169  default:
170  return PT_END;
171  }
172 
173  return PT_END;
174 }
Here is the caller graph for this function: