[gdal-dev] gdal 8-bit signed int support unavailable?

Even Rouault even.rouault at spatialys.com
Mon Jun 19 03:22:56 PDT 2017


On lundi 19 juin 2017 19:10:30 CEST NASAHARA Kenlo wrote:
> Hi, GDAL people:
> 
> I want to handle 8-bit signed integer raster data by C++
> but it seems GDAL does not such data type:
> https://naturalatlas.github.io/node-gdal/classes/Constants%20(GDT).html#prop
> -gdal.GDT_Byte
> 
> Does it mean GDAL cannot handle 8-bit signed int?

Kenlo,

There's no dedicated type for 8-bit signed int indeed. The hack used is to still use GDT_Byte 
but advertize PIXELTYPE=SIGNEDBYTE in the IMAGE_STRUCTURE metadata domain of the 
band. See http://gdal.org/gdal_datamodel.html

Statistics computation should take that into account to properly interpret the values as 
signed, but apart from a few drivers (from a quick search GTIff, netCDF, HFA, EHdr, ERS, MEM) 
that correctly interpret/set the PIXELTYPE=SIGNEDBYTE hint, other drivers will generally 
ignore it.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170619/a7f35fd7/attachment.html>


More information about the gdal-dev mailing list