ExportRasterToCOG Task
This task exports a raster to a Cloud Optimized GeoTIFF (COG) file format.
Example
; Start the application
e = ENVI()
; Open an input file
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
; Get the task from the catalog of ENVITasks
Task = ENVITask('ExportRasterToCOG')
; Define inputs
Task.INPUT_RASTER = Raster
; Run the task
Task.Execute
; Add the output to the Data Manager
e.Data.Add, Task.OUTPUT_RASTER
; Display the result
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Syntax
Result = ENVITask('ExportRasterToCOG')
Input properties (Set, Get): COMPRESSION_TYPE, DATA_IGNORE_VALUE, INPUT_RASTER, INTERLEAVE, OUTPUT_RASTER_URI, RESAMPLING_TYPE, TILE_MATRIX_SET
Output properties (Get only): OUTPUT_RASTER
Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.
Methods
This task inherits the following methods from ENVITask:
Properties
This task inherits the following properties from ENVITask:
This task also contains the following properties:
COMPRESSION_TYPE (optional)
Specify the type of compression. The choices are:
None
(default)Deflate
: More efficient than LZW but may cause compatibility issues with some software packagesJPEG
: For 8-bit (byte) data onlyLERC
LERC Deflate
LZW
All options except for JPEG
can be used for lossless compression. JPEG can be used for lossy compression.
DATA_IGNORE_VALUE (optional)
Specify a unique data value for pixels in the output raster that have a non-zero pixel state value. If you do not set this property and the input raster already has a data ignore value defined, that value will be used in the output COG file.
INPUT_RASTER (required)
Specify a raster to export to COG format.
INTERLEAVE (optional)
Specify a string indicating the data interleave of the output raster. The choices are:
BIP
(default): Band-interleaved-by-pixelBSQ
: Band sequential
OUTPUT_RASTER
This is a reference to the output raster.
OUTPUT_RASTER_URI (optional)
Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER. If you do not specify this property, the associated OUTPUT_RASTER will not be created. To force the creation of a temporary file set the property to an exclamation symbol (!).
RESAMPLING_TYPE (optional)
The resampling method to use when generating overviews and reprojecting. The choices are:
Average
: Computes the weighted average of all non-NODATA contributing pixels.Bilinear
(default): Performs a linear interpolation using four pixels to resample.Cubic Convolution
: Uses 16 pixels to approximate the sinc function using cubic polynomials to resample the image.Cubic Spline
: Performs a cubic spline resampling.Lanczos
: Performs a Lanczos windowed sinc resamplingNearest Neighbor
: Uses the nearest pixel without any interpolation.
TILE_MATRIX_SET (optional)
The tile matrix set to use for tile generation. Optimized should almost always be used. The choices are:
GoogleMapsCompatible
: Choose this option when creating Cloud Optimized GeoTIFF files for map services such as Google Maps.Optimized
(default): Choose this option in all other cases. It converts the input raster into a Cloud Optimized GeoTIFF file using 512 x 512 pixels, which provides the best performance in most cases.
Version History
ENVI 5.6.1 |
Introduced |
API Version
4.2
See Also
ENVITask, ExportRasterToCADRG Task, ExportRasterToENVI Task, ExportRasterToKMZ Task, ExportRasterToNITF20 Task, ExportRasterToNITF21 Task, ExportRasterToNSIF10 Task, ExportRasterToPNG Task, ExportRasterToTIFF Task