Converting a raster dataset to a JPEG2000 raster dataset
The following code example can also be applied to save to a Joint Photographic Experts Group (JPEG) and other writable raster formats with a little modification of the compression type and format string:
[Java]
static void convertToJPEG2000(IRasterDataset rasterDataset, IWorkspace
outputWorkspace)throws Exception{
//Set storage parameter for compression and quality
IRasterStorageDef rasterStorage = new RasterStorageDef();
rasterStorage.setCompressionType
(esriRasterCompressionType.esriRasterCompressionJPEG2000);
rasterStorage.setCompressionQuality(50);
//Save out to a JP2 file in the output workspace
ISaveAs2 saveAs = new ISaveAs2Proxy(rasterDataset);
saveAs.saveAsRasterDataset("output1.jp2", outputWorkspace, "JP2", rasterStorage);
}
See Also:
How to access a raster dataset or raster catalogDevelopment licensing | Deployment licensing |
---|---|
ArcView | ArcView |
ArcEditor | ArcEditor |
ArcInfo | ArcInfo |
Engine Developer Kit | Engine Runtime |