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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Kenlo Nasahara
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 Nishida Nasahara
Faculty of Life and Environmental Sciences
University of Tsukuba, Japan 305-8572
[hidden email]
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gdal 8-bit signed int support unavailable?

Even Rouault-2

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
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gdal 8-bit signed int support unavailable?

Kenlo Nasahara
Even, thanks a lot. It was a surprise for me that GDAL does not support 8-bit signed int. It may be better not to use it with GDAL. Kenlo Nasahara
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gdal 8-bit signed int support unavailable?

Even Rouault-2

On lundi 19 juin 2017 03:44:10 CEST Kenlo Nasahara wrote:

> Even, thanks a lot. It was a surprise for me that GDAL does not support

> 8-bit signed int. It may be better not to use it with GDAL. Kenlo Nasahara

 

If you've got the choice, use Int16 datatype instead.

 

>

>

>

> --

> View this message in context:

> http://osgeo-org.1560.x6.nabble.com/gdal-dev-gdal-8-bit-signed-int-support-

> unavailable-tp5324647p5324652.html Sent from the GDAL - Dev mailing list

> archive at Nabble.com.

> _______________________________________________

> gdal-dev mailing list

> [hidden email]

> https://lists.osgeo.org/mailman/listinfo/gdal-dev

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Loading...