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

◆ 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 213 of file rt_util.c.

213 {
214 switch (pt) {
215 case PT_1BB:
216 case PT_2BUI:
217 case PT_4BUI:
218 case PT_8BUI:
219 return GDT_Byte;
220 case PT_8BSI:
221#if POSTGIS_GDAL_VERSION >= 30700
222 return GDT_Int8;
223#endif
224 case PT_16BSI:
225 return GDT_Int16;
226 case PT_16BUI:
227 return GDT_UInt16;
228 case PT_32BSI:
229 return GDT_Int32;
230 case PT_32BUI:
231 return GDT_UInt32;
232#if POSTGIS_GDAL_VERSION >= 31100 && defined(GDT_Float16)
233 case PT_16BF:
234 return GDT_Float16;
235#endif
236 case PT_32BF:
237 return GDT_Float32;
238 case PT_64BF:
239 return GDT_Float64;
240 default:
241 return GDT_Unknown;
242 }
243
244 return GDT_Unknown;
245}
@ PT_32BUI
Definition librtcore.h:197
@ PT_16BF
Definition librtcore.h:198
@ PT_2BUI
Definition librtcore.h:190
@ PT_32BSI
Definition librtcore.h:196
@ PT_4BUI
Definition librtcore.h:191
@ PT_32BF
Definition librtcore.h:199
@ PT_1BB
Definition librtcore.h:189
@ PT_16BUI
Definition librtcore.h:195
@ PT_8BSI
Definition librtcore.h:192
@ PT_16BSI
Definition librtcore.h:194
@ PT_64BF
Definition librtcore.h:200
@ PT_8BUI
Definition librtcore.h:193

References PT_16BF, 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 RASTER_InterpolateRaster(), rt_band_load_offline_data(), rt_raster_gdal_rasterize(), rt_raster_gdal_warp(), and rt_raster_to_gdal_mem().

Here is the caller graph for this function: