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
Use this Plug-in Exporter class |
To 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 Files
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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.
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
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)
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)
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)
Export to Database
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)
params$=
user=YOURuser
password=YOURpassword
server=YOURserver
postgisrastername=YOURpostgisrastername
pixelsize:xxxm (number in metres)
srid:81989 (Spatial reference identifier, use EPSG code 27700 for OSGB)
createpyramid:true|false
autonaming:true|false
Example:
Params = "{"
Params += """user"":""qa"""
Params += ","
Params += """password"":""spatial"""
Params += ","
Params += """host"":""10.0.2.6"""Params += ","
Params += """port"":5433"
Params += ","
Params += """database"":""qa"""
Params += ","
Params += """table"":""raster2"""
Params += ","
Params += """column"":""raster"""
Params += ","
Params += """columnid"":""rid"""
Params += ","
Params += """resolution"":100"
Params += ","
Params += """blocksizex"":256"
Params += ","
Params += """blocksizey"":256"
Params += ","
Params += """pyramid"":true"
Params += ","
Params += """droptable"":true"
Params += "}"
SIS.ExportRaster("PostGISRasterExporter", "", Params)
Remarks
Available: D OD OM SISpy
Groups: