PostGIS  3.7.0dev-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 162 of file rt_util.c.

162  {
163  switch (gdt) {
164  case GDT_Byte:
165  return PT_8BUI;
166 #if POSTGIS_GDAL_VERSION >= 30700
167  case GDT_Int8:
168  return PT_8BSI;
169 #endif
170  case GDT_UInt16:
171  return PT_16BUI;
172  case GDT_Int16:
173  return PT_16BSI;
174  case GDT_UInt32:
175  return PT_32BUI;
176  case GDT_Int32:
177  return PT_32BSI;
178  case GDT_Float32:
179  return PT_32BF;
180  case GDT_Float64:
181  return PT_64BF;
182  default:
183  return PT_END;
184  }
185 
186  return PT_END;
187 }
@ PT_32BUI
Definition: librtcore.h:196
@ PT_32BSI
Definition: librtcore.h:195
@ PT_END
Definition: librtcore.h:199
@ PT_32BF
Definition: librtcore.h:197
@ PT_16BUI
Definition: librtcore.h:194
@ PT_8BSI
Definition: librtcore.h:191
@ PT_16BSI
Definition: librtcore.h:193
@ PT_64BF
Definition: librtcore.h:198
@ PT_8BUI
Definition: librtcore.h:192

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

Referenced by rt_band_new_offline_from_path(), and rt_raster_from_gdal_dataset().

Here is the caller graph for this function: