Answer
When using the 'sderaster' command with the import, insert, or update operations such as, 'sderaster -o import', the compression of the raster being generated can be specified as LZ77, JPEG, or JPEG 2000 (JP2) with the '-c' option. JPEG and JP2 can have the compression quality defined by the '-q' argument, but the quality value is defined differently for both. JPEG quality values can range from 0 to 100; whereas, JP2 can range from 0 to 255. The actual JP2 compression range is 1-255 for variable compression, and 0 for lossless compression.
When using an ArcGIS Desktop application to view the properties of a raster with JP2 compression that was created through the 'sderaster' command, the value specified for the compression quality will not match the value defined for the '-q' option. For example, consider a TIFF imported into SDE using JPEG2000 compression with a quality of 75:
Code:
C:\>sderaster -o import -l sample,raster -f c:\sample.tif -c JP2 -q 75...
Viewing the resulting raster's properties in an ArcGIS Desktop application will list the compression as 'JPEG2000 (29)'. The difference is accounted for by the usage of a fixed bitrate compression being applied through the 'sderaster' command; whereas, ArcGIS Desktop uses a proportional scale of 0-100 to reflect compression for both JPEG and JPEG2000.
The value indicated through the raster's properties dialog box in ArcGIS Desktop applications reflects the percentage of compression being applied. The ArcGIS Desktop equivalent of the '-q' argument can be determined by using the following formula:
Code:
<-q value>/255 * 100 = <Desktop value>