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 parameters (Set, Get): COMPRESSION_TYPE, DATA_IGNORE_VALUE, INPUT_RASTER, INTERLEAVE, OUTPUT_RASTER_URI, RESAMPLING_TYPE, TILE_MATRIX_SET

Output parameters (Get only): OUTPUT_RASTER

Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.

Input Parameters


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 packages
  • JPEG: For 8-bit (byte) data only
  • LERC
  • 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 parameter 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-pixel
  • BSQ: Band sequential

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 parameter, or set it to an exclamation symbol (!), ENVI creates a temporary file.
  • If you set it to the hash symbol (#), ENVI creates a file in the temporary directory, but this file will not be deleted when ENVI closes.

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 resampling
  • Nearest 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.

Output Parameters


OUTPUT_RASTER

This is a reference to the output raster.

Methods


Execute

Parameter

ParameterNames

Properties


DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

Version History


ENVI 5.6.1

Introduced

See Also


ENVITask, ExportRasterToCADRG Task, ExportRasterToENVI Task, ExportRasterToJPEG2000 Task, ExportRasterToKMZ Task, ExportRasterToNITF20 Task, ExportRasterToNITF21 Task, ExportRasterToNSIF10 Task, ExportRasterToPNG Task, ExportRasterToTIFF Task, Masking Support in ENVITasks