Issue with Postgis 3.7.0 - Float16 broken with raster2pgsql

Colin Craig wxflights at gmail.com
Mon Nov 2 16:04:46 PST 2026


Hello,

It looks like Float16 support is broken in Postgis 3.7.0.

*OS/Version Information:*

OS Ubuntu 24.04.5
Postgis version: 3.7.0
GDAL: 3.13

$: raster2pgsql
RELEASE: 3.7.0 GDAL_VERSION=31303 (1fdbb1c)

*Issue:*

It looks like raster2pgsql still cannot ingest rasters with the "float16"
data type. This was supposedly fixed in
https://trac.osgeo.org/postgis/ticket/5941.


*Reproduction Steps:*

*# Convert any Float32 or Float62 raster into float 16 using gdal_translate*
gdal_translate -ot float16 out.tif out2.tif
Input file size is 2345, 1597
0...10...20...30...40...50...60...70...80...90...100 - done.

$ raster2pgsql out2.tif
Processing 1/1: out2.tif
ERROR: rt_pixtype_size: Unknown pixeltype 13
ERROR: rt_raster_from_gdal_dataset: Unknown pixel type for GDAL band
ERROR: convert_raster: Could not convert VRT dataset to PostGIS raster
ERROR: process_rasters: Could not process raster: out2.tif
ERROR: Unable to process rasters

*More info:*

I believe the issue might be here:
https://github.com/postgis/postgis/blob/1fdbb1c/raster/rt_core/rt_util.c#L274 -
It looks like "GDT_Float16" is an enum constant, not a preprocessor macro
so this check to include Float16 support will always resolve to False. I
could be wrong, not super familiar with C.

Let me know if you need more information.

Best,
- Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20261102/2e94b139/attachment.htm>


More information about the postgis-users mailing list