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
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
