ExportRaster Method

Description

Exports raster data using a Plug-in Exporter.

Syntax

Visual Basic
Public Function ExportRaster( _
   ByVal clsExport As String, _
   ByVal filename As String, _
   ByVal parameters As String _
) As Integer

Parameters

clsExport

The Plug-in Exporter class to use for Export to:

ENVI (*.evi) "ENVI_GDALExporter"
ERDAS IMAGINE (*.img) "HFA_GDALExporter"
GIF (*.gif) "GIF_GDALExporter"
JPEG (Grayscale) (*.jpg) "JPEGGrayscale_GDALExporter"
JPEG (RGB) (*.jpg) "JPEG_GDALExporter"
JPEG 2000 (*.jp2;*.j2k;*.jpc;*.jpx;*.j2c) "JP2KAK_GDALExporter"
NITF (*.ntf) "NITF_GDALExporter"
PCI Geomatics Database File (*.pix) "PCIDSK_GDALExporter"
PNG (Grayscale) (*.png) "PNGGrayscale_GDALExporter"
PNG (Palette) (*.png) "PNGPalette_GDALExporter"
PNG (RGB/RGBA) (*.png) "PNG_GDALExporter"
TIFF (B&W) (*.tif) "GTiffBlackandWhite_GDALExporter"
TIFF (Grayscale) (*.tif) "GTiffGrayscale_GDALExporter"
TIFF (Palette) (*.tif) "GTiffPalette_GDALExporter"
TIFF (RGB/RGBA) (*.tif) "GTiff_GDALExporter"
 
filename
 
The name of the exported file.
 
parameters

Optional parameters used to configure the Plug-in Exporter. There must be no spaces in Parameters.

Parameters common to all formats:

RASTER SIZE: width, height (the raster size range is format-specific)

 

Export to ENVI:

INTERLEAVE={BIP,BIL,BSQ}

Example:

'Export to ENVI
clsExport = "ENVI_GDALExporter"
filename = "C:\test.evi"
parameters = "width=1024,height=1024,INTERLEAVE=BIP"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to ERDAS IMAGINE:

COMPRESSED={TRUE,FALSE} compress blocks. Default="FALSE"

Example:

'Export to ERDAS IMAGINE
clsExport = "HFA_GDALExporter"
filename = "C:\test.img"
parameters = "width=1024,height=1024,COMPRESSED=TRUE"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to GIF:

INTERLACING={TRUE,FALSE}
WORLDFILE={TRUE,FALSE} create Worldfile. Default="TRUE"
DITHERPALETTE={ColorCube125, ColorCube216, BlackWhite, GrayScale, Adaptive, OctTree}
DITHERALGORITHM={Default, SystemSnap, SystemDither, PaletteSnap, FloydSteinberg}

 

Example:

'Export to GIF
clsExport = "GIF_GDALExporter"
filename = "C:\test.gif"
parameters = "width=1024,height=1024,INTERLACING=TRUE,WORLDFILE=FALSE"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to JPEG (Grayscale):

PROGRESSIVE={TRUE,FALSE}
QUALITY={0,...,100} good=100, bad=0, default=75
WORLDFILE={TRUE,FALSE} create Worldfile. Default="TRUE"
DITHERALGORITHM={Default, SystemSnap, SystemDither, PaletteSnap, FloydSteinberg}


Example:

'Export to JPEG Grayscale
clsExport = "JPEGGrayscale_GDALExporter"
filename = "C:\testGRAY.jpg"
parameters = "width=1024,height=1024,PROGRESSIVE=TRUE,QUALITY=80,WORLDFILE=FALSE"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to JPEG (RGB):

PROGRESSIVE={TRUE,FALSE}
QUALITY={0,...,100} good=100, bad=0. Default=75
WORLDFILE={TRUE,FALSE} create Worldfile. Default="TRUE"

Example:

'Export to JPEG RGB
clsExport = "JPEG_GDALExporter"
filename = "C:\testRGB.jpg"
parameters = "width=1024,height=1024,PROGRESSIVE=TRUE,QUALITY=80,WORLDFILE=FALSE"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to JPEG 2000 (*.jp2, *.j2k, *.jpc, *.jpx, *.j2c):

QUALITY={0,...,100} lossless=100, most Lossy=0, default=75
LAYERS={1,...,20}
GeoJP2={TRUE,FALSE} default="TRUE"
GMLJP2={TRUE,FALSE} default="TRUE"

Example:

'Export to JPEG 2000
clsExport = "JP2KAK_GDALExporter"
filename = "C:\test2000.jp2"
parameters = "width=1024,height=1024,QUALITY=80,LAYERS=1,GeoJP2=TRUE,GMLJP2=FALSE"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to NITF:

NO ADDITIONAL PARAMETER OPTIONS

Example:

'Export to NITF
clsExport = "NITF_GDALExporter"
filename = "C:\test.ntf"
parameters = "width=1024,height=1024"
sis.ExportRaster(clsExport, filename, parameters)

 

Oracle

clsExport = "OracleGeoRasterExporter"

 

OracleGeoRasterExporter

params$=

user=YOURuser

password=YOURpassword

server=YOURserver

georastername=YOURgeorastername

pixelsize:xxxm (number in metres)

srid:81989 (Spatial reference identifier, use EPSG code 27700 for OSGB)

createpyramid:true|false

autonaming:true|false

 

Example

Dim Params As String

        Params = "{"
        Params += """user"":""qa"""
        Params += ","
        Params += """password"":""spatial"""
        Params += ","
        Params += """server"":""spatial_qaserver"""
        Params += ","
        Params += """georastername"":""regressgeoraster"""
        Params += ","
        Params += """pixelsize"":1153m"
        Params += ","
        Params += """srid"":81989"
        Params += ","
        Params += """createpyramid"":true"
        Params += ","
        Params += """autonaming"":false"
        Params += "}"

sis.Export("OracleGeoRasterExporter", "", Params)

 

Export to PCI Geomatics Database File:

NO ADDITIONAL PARAMETER OPTIONS

Example:

'Export to PCI Geomatics Database File
clsExport = "PCIDSK_GDALExporter"
filename = "C:\test.pix"
parameters = "width=1024,height=1024"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to PNG (Grayscale):

WORLDFILE={TRUE,FALSE} create Worldfile. Default="TRUE"
DITHERALGORITHM={Default, SystemSnap, SystemDither, PaletteSnap, FloydSteinberg}

Example:

'Export to PNG Grayscale
clsExport = "PNGGrayscale_GDALExporter"
filename = "C:\testGRAY.png"
parameters = "width=1024,height=1024,WORLDFILE=TRUE"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to PNG (Palette):

WORLDFILE={TRUE,FALSE} create Worldfile. Default="TRUE"
DITHERPALETTE={ColorCube125, ColorCube216, BlackWhite, GrayScale, Adaptive, OctTree}
DITHERALGORITHM={Default, SystemSnap, SystemDither, PaletteSnap, FloydSteinberg}

Example:

'Export to PNG Palette
clsExport = "PNGPalette_GDALExporter"
filename = "C:\testPalette.png"
parameters = "width=1024,height=1024,WORLDFILE=TRUE"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to PNG (RGB)/(RGBA):

WORLDFILE={TRUE,FALSE} create Worldfile. Default="TRUE"

Example:

'Export to PNG RGB
clsExport = "PNG_GDALExporter"
filename = "C:\testRGB.png"
parameters = "width=1024,height=1024,WORLDFILE=TRUE"
sis.ExportRaster(clsExport, filename, parameters)

Note: The alpha channel will be exported only if there is already transparency in the image to be exported. Transparency cannot be created if this is not the case.

Also note that before you export to PNG (RGBA) you must make sure the Map Drawing Engine option (Drawing and Printing tab of the Options dialog) is set to Advanced.

Export to TIFF (B&W):

NBITS=1 there is no alternative value for this parameter but a GISLink application must pass the parameter "NBITS=1" explicitly
INTERLEAVE={"PIXEL","BAND"} default="PIXEL"
PROFILE={"GDALGeoTIFF","GeoTIFF","BASELINE"} default={"GDALGeoTIFF"}
TILED={"TRUE","FALSE"} switch to tiled format. Default="FALSE"
WORLDFILE={"TRUE","FALSE"} create Worldfile. Default="TRUE"
PHOTOMETRIC={"MINISWHITE","MINISBLACK"} default="MINISBLACK"
COMPRESS={"NONE","CCITTRLE","CCITTFAX3","CCITTFAX4} default="NONE"
DITHERALGORITHM={SystemSnap, SystemDither, PaletteSnap, FloydSteinberg} default="FloydSteinberg"

Example:

'Export to TIFF B&W
clsExport = "GTiffBlackAndWhite_GDALExporter"
filename = "C:\testBW.tif"
parameters = "width=1024,height=1024,NBITS=1,INTERLEAVE=BAND,PROFILE=GeoTiff,TILED=FALSE,WORLDFILE=FALSE,PHOTOMETRIC=MINISWHITE,COMPRESS=None"
sis.ExportRaster(clsExport, filename, parameters


Export to TIFF (Grayscale):

INTERLEAVE={"PIXEL","BAND"} default="PIXEL"
PROFILE={"GDALGeoTIFF","GeoTIFF","BASELINE"} default={"GDALGeoTIFF"}
TILED={"TRUE","FALSE"} switch to tiled format. Default="FALSE"
WORLDFILE={"TRUE","FALSE"} create Worldfile. Default="TRUE"
COMPRESS={"NONE","LZW","PACKBITS","DEFLATE"}default="NONE"
ZLEVEL={"1" TO "9"}a value of "9" is best, "1" is least compression. Default="6".
Note: ZLEVEL is only a valid parameter when COMPRESS="DEFLATE" is selected.
DITHERALGORITHM={Default, SystemSnap, SystemDither, PaletteSnap, FloydSteinberg}

 

Example:

'Export to TIFF Grayscale
clsExport = "GTiffGrayscale_GDALExporter"
filename = "C:\testGray.tif"
parameters = "width=1024,height=1024,INTERLEAVE=BAND,PROFILE=GeoTiff,TILED=FALSE,WORLDFILE=FALSE,COMPRESS=None"
sis.ExportRaster(clsExport, filename, parameters)


Export to TIFF (Palette):

INTERLEAVE={"PIXEL","BAND"} default="PIXEL"
PROFILE={"GDALGeoTIFF","GeoTIFF","BASELINE"} default={"GDALGeoTIFF"}
TILED={"TRUE","FALSE"} switch to tiled format. Default="FALSE"
WORLDFILE={"TRUE","FALSE"} create Worldfile. Default="TRUE"
COMPRESS={"NONE","LZW","PACKBITS","DEFLATE"} default="NONE"
ZLEVEL={"1" TO "9"}a value of "9" is best, "1" is least compression. Default="6".
Note: ZLEVEL is only a valid parameter when COMPRESS="DEFLATE" is selected.
DITHERPALETTE={ColorCube125, ColorCube216, BlackWhite, GrayScale, Adaptive, OctTree}
DITHERALGORITHM={Default, SystemSnap, SystemDither, PaletteSnap, FloydSteinberg}

Example:

'Export to paletted TIFF
clsExport = "GTiffPalette_GDALExporter"
filename = "C:\test.tif"
parameters = "width=1024,height=1024,INTERLEAVE=BAND,PROFILE=GeoTiff,TILED=FALSE,WORLDFILE=FALSE,COMPRESS=None"
sis.ExportRaster(clsExport, filename, parameters)

 

Export to TIFF (RGB):

INTERLEAVE={"PIXEL","BAND"} default="PIXEL"
PROFILE={"GDALGeoTIFF","GeoTIFF","BASELINE"} default={"GDALGeoTIFF"}
TILED={"TRUE","FALSE"} switch to tiled format. Default="FALSE"
WORLDFILE={"TRUE","FALSE"} create Worldfile. Default="TRUE"
COMPRESS={"NONE","LZW","PACKBITS","DEFLATE"} default="NONE"
ZLEVEL={"1" TO "9"}a value of "9" is best, "1" is least compression. Default="6".
Note: ZLEVEL is only a valid parameter when COMPRESS="DEFLATE" is selected.
ALPHA={"TRUE", "FALSE"}default="TRUE"

Note: The alpha channel will be exported only if there is already transparency in the image to be exported. Transparency cannot be created if this is not the case.

Also note that before you export to TIFF (RGBA) you must make sure the Map Drawing Engine option (Drawing and Printing tab of the Options dialog) is set to Advanced.

Example:

'Export to TIFF RGB
clsExport = "GTiff_GDALExporter"
filename = "C:\testRGB.tif"
parameters = "width=1024,height=1024,INTERLEAVE=BAND,PROFILE=GeoTiff,TILED=FALSE,WORLDFILE=FALSE,COMPRESS=DEFLATE,ZLEVEL=9"
sis.ExportRaster(clsExport, filename, parameters)

Remarks

Available: MM ME MD OD OM SISpy

Groups:


Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).