Opened 13 years ago

Closed 12 years ago

#2717 closed defect (fixed)

Saving bil, bip, bsq, and env as 8 bit signed

Reported by: gaopeng Owned by: warmerdam
Priority: normal Milestone: 1.7.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: EHdr
Cc:

Description

Saving 8 bit signed int data to bil, bip, bsq, and env do not output 8 bit signed int data, instead convert to 8 bit unsigned int.

Change History (9)

comment:1 Changed 12 years ago by warmerdam

Keywords: EHdr added
Milestone: 1.6.21.7.0
Status: newassigned

Gao,

What are you referring to by "and env"? I will try to add support for signed 8bit to the EHDR driver - that's the objective here, right?

comment:2 Changed 12 years ago by warmerdam

Actually, on review of existing .hdr files I have I am not clear on how to establish whether the raster pixels are to be interpreted as signed or unsigned. Can you provide a .hdr example of a signed 8bit raster?

comment:3 Changed 12 years ago by gaopeng

Frank,

There is no real existing sample. But the latest enhancement with PIXELTYPE should be able to handle signed 8 bit, i.e.

NBITS 8 PIXELTYPE SIGNEDINT

"ENV" is ITT-VIS ENVI format. It also should support 8 bit signed.

comment:4 Changed 12 years ago by warmerdam

Implemented SIGNEDBYTE support for EHDR driver in trunk (r17283) and testing (r17284).

still need envi support, and then backport to 1.6-esri.

comment:5 Changed 12 years ago by warmerdam

Hmm, I'm not sure what "data type" value would correspond with signed byte in an ENVI file. A search on the new turns up this definition for data type.

data type The type of data representation, where 1=8-bit byte; 2=16-bit signed integer; 3=32-bit signed long integer; 4=32-bit floating point; 5=64-bit double-precision floating point; 6=2x32-bit complex, real-imaginary pair of double precision; 9=2x64-bit double-precision complex, real-imaginary pair of double precision; 12=16-bit unsigned integer; 13=32-bit unsigned long integer; 14=64-bit signed long integer; and 15=64-bit unsigned long integer.

but this does not address signedness of the byte type.

comment:6 Changed 12 years ago by warmerdam

EHDR changes backported into 1.6-esri branch (r17285).

I don't have a plan to address this for ENVI format at this time.

comment:7 Changed 12 years ago by gaopeng

It turned out ENVI format doesn't support 8-bit signed integer type. See below.


Gao -

No, ENVI (or IDL) doesn't support signed 8 bit pixel values - just unsigned bytes.

-Kirk


From: Peng Gao pgao@… Sent: Monday, June 22, 2009 2:10 PM To: Kirk Benell Subject: Does ENVI support 8-bit signed integer pixel value? (FW: [GDAL]#2717: Saving bil, bip, bsq, and env as 8 bit signed)

Kirk,

Does ENVI support 8-bit signed integer pixel value?

comment:8 Changed 12 years ago by gaopeng

The current document seems to imply the 8 bit signed is supported, http://www.gdal.org/frmt_various.html#ENVI.

"GDAL should support reading bil, bip and bsq interleaved formats, and most pixel types are supported, including 8, 16 and 32bit signed and unsigned integers, 32bit and 64 bit floating point, and 32bit and 64bit complex floating point."

comment:9 Changed 12 years ago by warmerdam

Resolution: fixed
Status: assignedclosed

I have adjusted the docs a bit in r17286. Closing ticket as all work seemed to be done.

Note: See TracTickets for help on using tickets.