Class gdal
- java.lang.Object
-
- org.gdal.gdal.gdal
-
public class gdal extends java.lang.Object
Class gdal is an uninstanciable class providing various utility functions as static methods.In particular, it provides :
- gdal.AllRegister() and gdal.Open() methods.
- bindings for various GDAL algorithms.
- bindings for some general purpose CPL functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
AllRegister()
Register all known configured GDAL drivers.static void
ApplyGeoTransform(double[] padfGeoTransform, double dfPixel, double dfLine, double[] pdfGeoX, double[] pdfGeoY)
Apply GeoTransform to x/y coordinate.static Dataset
ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds)
static Dataset
ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, boolean inverse)
static Dataset
ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, boolean inverse, double srcUnitToMeter)
static Dataset
ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, boolean inverse, double srcUnitToMeter, double dstUnitToMeter)
static Dataset
ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, boolean inverse, double srcUnitToMeter, double dstUnitToMeter, java.util.Vector options)
static Dataset
AutoCreateWarpedVRT(Dataset src_ds)
Create virtual warped dataset automatically.static Dataset
AutoCreateWarpedVRT(Dataset src_ds, java.lang.String src_wkt)
Create virtual warped dataset automatically.static Dataset
AutoCreateWarpedVRT(Dataset src_ds, java.lang.String src_wkt, java.lang.String dst_wkt)
Create virtual warped dataset automatically.static Dataset
AutoCreateWarpedVRT(Dataset src_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int eResampleAlg)
Create virtual warped dataset automatically.static Dataset
AutoCreateWarpedVRT(Dataset src_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int eResampleAlg, double maxError)
Create virtual warped dataset automatically.static Dataset
BuildVRT(java.lang.String dest, java.util.Vector source_filenames, BuildVRTOptions options)
static Dataset
BuildVRT(java.lang.String dest, java.util.Vector source_filenames, BuildVRTOptions options, ProgressCallback callback)
static Dataset
BuildVRT(java.lang.String dest, Dataset[] object_list_count, BuildVRTOptions options)
static Dataset
BuildVRT(java.lang.String dest, Dataset[] object_list_count, BuildVRTOptions options, ProgressCallback callback)
static void
ClearCredentials()
static void
ClearCredentials(java.lang.String pszPathPrefix)
static void
ClearPathSpecificOptions()
static void
ClearPathSpecificOptions(java.lang.String pszPathPrefix)
static int
ComputeMedianCutPCT(Band red, Band green, Band blue, int num_colors, ColorTable colors)
Compute optimal PCT for RGB image.static int
ComputeMedianCutPCT(Band red, Band green, Band blue, int num_colors, ColorTable colors, ProgressCallback callback)
Compute optimal PCT for RGB image.static int
ComputeProximity(Band srcBand, Band proximityBand)
Compute the proximity of all pixels in the image to a set of pixels in the source image.static int
ComputeProximity(Band srcBand, Band proximityBand, java.util.Vector options)
Compute the proximity of all pixels in the image to a set of pixels in the source image.static int
ComputeProximity(Band srcBand, Band proximityBand, java.util.Vector options, ProgressCallback callback)
Compute the proximity of all pixels in the image to a set of pixels in the source image.static int
ContourGenerate(Band srcBand, double contourInterval, double contourBase, double[] fixedLevelCount, int useNoData, double noDataValue, Layer dstLayer, int idField, int elevField)
static int
ContourGenerate(Band srcBand, double contourInterval, double contourBase, double[] fixedLevelCount, int useNoData, double noDataValue, Layer dstLayer, int idField, int elevField, ProgressCallback callback)
static int
ContourGenerateEx(Band srcBand, Layer dstLayer)
static int
ContourGenerateEx(Band srcBand, Layer dstLayer, java.util.Vector options)
static int
ContourGenerateEx(Band srcBand, Layer dstLayer, java.util.Vector options, ProgressCallback callback)
static int
CopyFile(java.lang.String pszSource, java.lang.String pszTarget)
static int
CopyFile(java.lang.String pszSource, java.lang.String pszTarget, SWIGTYPE_p_VSILFILE fpSource)
static int
CopyFile(java.lang.String pszSource, java.lang.String pszTarget, SWIGTYPE_p_VSILFILE fpSource, long nSourceSize)
static int
CopyFile(java.lang.String pszSource, java.lang.String pszTarget, SWIGTYPE_p_VSILFILE fpSource, long nSourceSize, java.util.Vector options)
static int
CopyFile(java.lang.String pszSource, java.lang.String pszTarget, SWIGTYPE_p_VSILFILE fpSource, long nSourceSize, java.util.Vector options, ProgressCallback callback)
static java.lang.String
CPLBinaryToHex(byte[] nBytes)
static byte[]
CPLHexToBinary(java.lang.String pszHex)
static Dataset
CreatePansharpenedVRT(java.lang.String pszXML, Band panchroBand, Band[] nInputSpectralBands)
static int
DataTypeIsComplex(int eDataType)
Is data type complex?static int
DataTypeUnion(int a, int b)
static void
Debug(java.lang.String msg_class, java.lang.String message)
Display a debugging message.static java.lang.String
DecToDMS(double dfAngle, java.lang.String pszAxis)
static java.lang.String
DecToDMS(double dfAngle, java.lang.String pszAxis, int nPrecision)
static double
DecToPackedDMS(double dfDec)
static Dataset
DEMProcessing(java.lang.String dest, Dataset dataset, java.lang.String pszProcessing, java.lang.String pszColorFilename, DEMProcessingOptions options)
static Dataset
DEMProcessing(java.lang.String dest, Dataset dataset, java.lang.String pszProcessing, java.lang.String pszColorFilename, DEMProcessingOptions options, ProgressCallback callback)
static int
DitherRGB2PCT(Band red, Band green, Band blue, Band target, ColorTable colors)
24bit to 8bit conversion with dithering.static int
DitherRGB2PCT(Band red, Band green, Band blue, Band target, ColorTable colors, ProgressCallback callback)
24bit to 8bit conversion with dithering.static void
DontUseExceptions()
static void
Error(int msg_class, int err_code, java.lang.String msg)
Report an error.static void
ErrorReset()
Erase any traces of previous errors.static java.lang.String
EscapeString(byte[] byteArray, int scheme)
Apply escaping to string to preserve special characters.static java.lang.String
EscapeString(java.lang.String str, int scheme)
Apply escaping to string to preserve special characters.static int
FileFromMemBuffer(java.lang.String utf8_path, byte[] nBytes)
static int
FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations)
Fill selected raster regions by interpolation from the edges.static int
FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations, java.util.Vector options)
Fill selected raster regions by interpolation from the edges.static int
FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations, java.util.Vector options, ProgressCallback callback)
Fill selected raster regions by interpolation from the edges.static void
FinderClean()
static java.lang.String
FindFile(java.lang.String pszClass, java.lang.String utf8_path)
static Dataset
Footprint(java.lang.String dest, Dataset srcDS, FootprintOptions options)
static Dataset
Footprint(java.lang.String dest, Dataset srcDS, FootprintOptions options, ProgressCallback callback)
static int
Footprint(Dataset dstDS, Dataset srcDS, FootprintOptions options)
static int
Footprint(Dataset dstDS, Dataset srcDS, FootprintOptions options, ProgressCallback callback)
static int
FPolygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField)
static int
FPolygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, java.util.Vector options)
static int
FPolygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, java.util.Vector options, ProgressCallback callback)
static int
GCPsToGeoTransform(GCP[] gcpArray, double[] outGeoTransform)
Generate Geotransform from GCPs.static int
GCPsToGeoTransform(GCP[] gcpArray, double[] outGeoTransform, int bApproxOK)
Generate Geotransform from GCPs.static double
GDAL_GCP_GCPLine_get(GCP gcp)
static void
GDAL_GCP_GCPLine_set(GCP gcp, double dfGCPLine)
static double
GDAL_GCP_GCPPixel_get(GCP gcp)
static void
GDAL_GCP_GCPPixel_set(GCP gcp, double dfGCPPixel)
static double
GDAL_GCP_GCPX_get(GCP gcp)
static void
GDAL_GCP_GCPX_set(GCP gcp, double dfGCPX)
static double
GDAL_GCP_GCPY_get(GCP gcp)
static void
GDAL_GCP_GCPY_set(GCP gcp, double dfGCPY)
static double
GDAL_GCP_GCPZ_get(GCP gcp)
static void
GDAL_GCP_GCPZ_set(GCP gcp, double dfGCPZ)
static java.lang.String
GDAL_GCP_Id_get(GCP gcp)
static void
GDAL_GCP_Id_set(GCP gcp, java.lang.String pszId)
static java.lang.String
GDAL_GCP_Info_get(GCP gcp)
static void
GDAL_GCP_Info_set(GCP gcp, java.lang.String pszInfo)
static void
GDALDestroyDriverManager()
static java.lang.String
GDALInfo(Dataset hDataset, InfoOptions infoOptions)
static java.lang.String
GDALMultiDimInfo(Dataset hDataset, MultiDimInfoOptions infoOptions)
static java.lang.String
GDALVectorInfo(Dataset hDataset, VectorInfoOptions infoOptions)
static java.lang.String[]
GeneralCmdLineProcessor(java.lang.String[] args)
General utility option processing.static java.lang.String[]
GeneralCmdLineProcessor(java.lang.String[] args, int options)
General utility option processing.static java.util.Vector
GeneralCmdLineProcessor(java.util.Vector args)
General utility option processing.static java.util.Vector
GeneralCmdLineProcessor(java.util.Vector args, int options)
General utility option processing.static java.lang.String
GetActualURL(java.lang.String utf8_path)
static int
GetCacheMax()
Get maximum cache memory.static int
GetCacheUsed()
Get cache memory used.static int
GetColorInterpretationByName(java.lang.String pszColorInterpName)
static java.lang.String
GetColorInterpretationName(int eColorInterp)
Get name of color interpretation.static java.lang.String
GetConfigOption(java.lang.String key)
Get the value of a configuration option.static java.lang.String
GetConfigOption(java.lang.String key, java.lang.String defaultValue)
Get the value of a configuration option.static java.util.Hashtable
GetConfigOptions()
static java.lang.String
GetCredential(java.lang.String pszPathPrefix, java.lang.String pszKey)
static java.lang.String
GetCredential(java.lang.String pszPathPrefix, java.lang.String pszKey, java.lang.String pszDefault)
static int
GetDataTypeByName(java.lang.String dataTypeName)
Get data type by symbolic name.static java.lang.String
GetDataTypeName(int eDataType)
Get name of data type.static int
GetDataTypeSize(int eDataType)
Get data type size in bits.static Driver
GetDriver(int iDriver)
Fetch driver by index.static Driver
GetDriverByName(java.lang.String name)
Fetch a driver based on the short name.static int
GetDriverCount()
Fetch the number of registered drivers.static long
GetErrorCounter()
static java.lang.String
GetFileSystemOptions(java.lang.String utf8_path)
static java.util.Vector
GetFileSystemsPrefixes()
static java.lang.String
GetGlobalConfigOption(java.lang.String pszKey)
static java.lang.String
GetGlobalConfigOption(java.lang.String pszKey, java.lang.String pszDefault)
static java.lang.String
GetJPEG2000StructureAsString(java.lang.String pszFilename)
static java.lang.String
GetJPEG2000StructureAsString(java.lang.String pszFilename, java.util.Vector options)
static java.lang.String
GetLastErrorMsg()
Get the last error message.static int
GetLastErrorNo()
Fetch the last error number.static int
GetLastErrorType()
Fetch the last error type.static byte[]
GetMemFileBuffer(java.lang.String fileName)
Fetch buffer underlying memory file.static int
GetNumCPUs()
static java.lang.String
GetPaletteInterpretationName(int ePaletteInterp)
Get name of palette interpretation.static java.lang.String
GetPathSpecificOption(java.lang.String pszPathPrefix, java.lang.String pszKey)
static java.lang.String
GetPathSpecificOption(java.lang.String pszPathPrefix, java.lang.String pszKey, java.lang.String pszDefault)
static java.lang.String
GetSignedURL(java.lang.String utf8_path)
static java.lang.String
GetSignedURL(java.lang.String utf8_path, java.util.Vector options)
static SWIGTYPE_p_GDALSubdatasetInfo
GetSubdatasetInfo(java.lang.String pszFileName)
static java.lang.String
GetThreadLocalConfigOption(java.lang.String pszKey)
static java.lang.String
GetThreadLocalConfigOption(java.lang.String pszKey, java.lang.String pszDefault)
static long
GetUsablePhysicalRAM()
static boolean
GetUseExceptions()
static java.lang.String
GOA2GetAccessToken(java.lang.String pszRefreshToken, java.lang.String pszScope)
static java.lang.String
GOA2GetAuthorizationURL(java.lang.String pszScope)
static java.lang.String
GOA2GetRefreshToken(java.lang.String pszAuthToken, java.lang.String pszScope)
static Dataset
Grid(java.lang.String dest, Dataset dataset, GridOptions options)
static Dataset
Grid(java.lang.String dest, Dataset dataset, GridOptions options, ProgressCallback callback)
static int
GridCreate(java.lang.String algorithmOptions, double[][] points, double xMin, double xMax, double yMin, double yMax, int xSize, int ySize, int dataType, java.nio.ByteBuffer nioBuffer)
static int
GridCreate(java.lang.String algorithmOptions, double[][] points, double xMin, double xMax, double yMin, double yMax, int xSize, int ySize, int dataType, java.nio.ByteBuffer nioBuffer, ProgressCallback callback)
static int
HasTriangulation()
static Driver
IdentifyDriver(java.lang.String name)
Identify the driver that can open a raster file.static Driver
IdentifyDriver(java.lang.String name, java.util.Vector fileList)
Identify the driver that can open a raster file.static Driver
IdentifyDriverEx(java.lang.String utf8_path)
static Driver
IdentifyDriverEx(java.lang.String utf8_path, long nIdentifyFlags)
static Driver
IdentifyDriverEx(java.lang.String utf8_path, long nIdentifyFlags, java.util.Vector allowed_drivers)
static Driver
IdentifyDriverEx(java.lang.String utf8_path, long nIdentifyFlags, java.util.Vector allowed_drivers, java.util.Vector sibling_files)
static double[]
InvGeoTransform(double[] gt_in)
Invert Geotransform.static int
InvGeoTransform(double[] gt_in, double[] gt_out)
Invert Geotransform.static boolean
IsLineOfSightVisible(Band band, int xA, int yA, double zA, int xB, int yB, double zB)
static boolean
IsLineOfSightVisible(Band band, int xA, int yA, double zA, int xB, int yB, double zB, java.util.Vector options)
static int
Mkdir(java.lang.String path, int mode)
Create a directory.static int
MkdirRecursive(java.lang.String utf8_path, int mode)
static Dataset
MultiDimTranslate(java.lang.String dest, Dataset[] object_list_count, MultiDimTranslateOptions multiDimTranslateOptions)
static Dataset
MultiDimTranslate(java.lang.String dest, Dataset[] object_list_count, MultiDimTranslateOptions multiDimTranslateOptions, ProgressCallback callback)
static Dataset
Nearblack(java.lang.String dest, Dataset srcDS, NearblackOptions options)
static Dataset
Nearblack(java.lang.String dest, Dataset srcDS, NearblackOptions options, ProgressCallback callback)
static int
Nearblack(Dataset dstDS, Dataset srcDS, NearblackOptions options)
static int
Nearblack(Dataset dstDS, Dataset srcDS, NearblackOptions options, ProgressCallback callback)
static Dataset
Open(java.lang.String name)
Open a raster file as a Dataset object.static Dataset
Open(java.lang.String name, int eAccess)
Open a raster file as a Dataset object.static Dataset
OpenEx(java.lang.String utf8_path)
static Dataset
OpenEx(java.lang.String utf8_path, long nOpenFlags)
static Dataset
OpenEx(java.lang.String utf8_path, long nOpenFlags, java.util.Vector allowed_drivers)
static Dataset
OpenEx(java.lang.String utf8_path, long nOpenFlags, java.util.Vector allowed_drivers, java.util.Vector open_options)
static Dataset
OpenEx(java.lang.String utf8_path, long nOpenFlags, java.util.Vector allowed_drivers, java.util.Vector open_options, java.util.Vector sibling_files)
static Dataset
OpenShared(java.lang.String name)
Open a raster file as a Dataset object.static Dataset
OpenShared(java.lang.String name, int eAccess)
Open a raster file as a GDALDataset.static double
PackedDMSToDec(double dfPacked)
static java.util.Vector
ParseCommandLine(java.lang.String utf8_path)
static XMLNode
ParseXMLString(java.lang.String xmlString)
Parse an XML string into tree form.static int
Polygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField)
static int
Polygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, java.util.Vector options)
static int
Polygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, java.util.Vector options, ProgressCallback callback)
static void
PopErrorHandler()
Pop error handler off stack.static void
PopFinderLocation()
static int
PushErrorHandler()
Push the quiet error handler.static int
PushErrorHandler(java.lang.String callbackName)
Push a new error handler.static void
PushFinderLocation(java.lang.String utf8_path)
static Dataset
Rasterize(java.lang.String dest, Dataset srcDS, RasterizeOptions options)
static Dataset
Rasterize(java.lang.String dest, Dataset srcDS, RasterizeOptions options, ProgressCallback callback)
static int
Rasterize(Dataset dstDS, Dataset srcDS, RasterizeOptions options)
static int
Rasterize(Dataset dstDS, Dataset srcDS, RasterizeOptions options, ProgressCallback callback)
static int
RasterizeLayer(Dataset dataset, int[] bands, Layer layer)
static int
RasterizeLayer(Dataset dataset, int[] bands, Layer layer, double[] burn_values)
static int
RasterizeLayer(Dataset dataset, int[] bands, Layer layer, double[] burn_values, java.util.Vector options)
static int
RasterizeLayer(Dataset dataset, int[] bands, Layer layer, double[] burn_values, java.util.Vector options, ProgressCallback callback)
static java.util.Vector
ReadDir(java.lang.String path)
Read names in a directory.static java.util.Vector
ReadDir(java.lang.String utf8_path, int nMaxFiles)
static java.util.Vector
ReadDirRecursive(java.lang.String utf8_path)
static int
RegenerateOverview(Band srcBand, Band overviewBand)
Generate downsampled overview.static int
RegenerateOverview(Band srcBand, Band overviewBand, java.lang.String resampling)
Generate downsampled overview.static int
RegenerateOverview(Band srcBand, Band overviewBand, java.lang.String resampling, ProgressCallback callback)
Generate downsampled overview.static int
RegenerateOverviews(Band srcBand, Band[] overviewBands)
Generate downsampled overviews.static int
RegenerateOverviews(Band srcBand, Band[] overviewBands, java.lang.String resampling)
Generate downsampled overviews.static int
RegenerateOverviews(Band srcBand, Band[] overviewBands, java.lang.String resampling, ProgressCallback callback)
Generate downsampled overviews.static int
Rename(java.lang.String oldpath, java.lang.String newpath)
Rename a file.static int
ReprojectImage(Dataset src_ds, Dataset dst_ds)
Reproject image.static int
ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt)
Reproject image.static int
ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt)
Reproject image.static int
ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int resampleAlg)
Reproject image.static int
ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int resampleAlg, double warpMemoryLimit)
Reproject image.static int
ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int resampleAlg, double warpMemoryLimit, double maxError)
Reproject image.static int
ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int resampleAlg, double warpMemoryLimit, double maxError, ProgressCallback callback)
Reproject image.static int
ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int eResampleAlg, double WarpMemoryLimit, double maxerror, ProgressCallback callback, java.util.Vector options)
static int
Rmdir(java.lang.String path)
Delete a directory.static int
RmdirRecursive(java.lang.String utf8_path)
static java.lang.String
SerializeXMLTree(XMLNode xmlnode)
Convert tree into string document.static void
SetCacheMax(int newSize)
Set maximum cache memory.static void
SetConfigOption(java.lang.String key, java.lang.String value)
Set a configuration option for GDAL/OGR use.static void
SetCredential(java.lang.String pszPathPrefix, java.lang.String pszKey, java.lang.String pszValue)
static void
SetCurrentErrorHandlerCatchDebug(int bCatchDebug)
static int
SetErrorHandler()
Set a quiet global error handler.static int
SetErrorHandler(SWIGTYPE_p_CPLErrorHandler pfnErrorHandler)
static int
SetErrorHandler(SWIGTYPE_p_CPLErrorHandler pfnErrorHandler, SWIGTYPE_p_void user_data)
static void
SetPathSpecificOption(java.lang.String pszPathPrefix, java.lang.String pszKey, java.lang.String pszValue)
static void
SetThreadLocalConfigOption(java.lang.String pszKey, java.lang.String pszValue)
static int
SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold)
Removes small raster polygons.static int
SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness)
Removes small raster polygons.static int
SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness, java.util.Vector options)
Removes small raster polygons.static int
SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness, java.util.Vector options, ProgressCallback callback)
Removes small raster polygons.static SuggestedWarpOutputRes
SuggestedWarpOutput(Dataset src, java.util.Vector options)
static SuggestedWarpOutputRes
SuggestedWarpOutput(Dataset src, Transformer transformer)
static Dataset
TileIndex(java.lang.String dest, java.util.Vector source_filenames, TileIndexOptions options)
static Dataset
TileIndex(java.lang.String dest, java.util.Vector source_filenames, TileIndexOptions options, ProgressCallback callback)
static Dataset
Translate(java.lang.String dest, Dataset dataset, TranslateOptions translateOptions)
static Dataset
Translate(java.lang.String dest, Dataset dataset, TranslateOptions translateOptions, ProgressCallback callback)
static int
Unlink(java.lang.String fileName)
Delete a file.static boolean
UnlinkBatch(java.util.Vector files)
static void
UseExceptions()
static Dataset
VectorTranslate(java.lang.String dest, Dataset srcDS, VectorTranslateOptions options)
static Dataset
VectorTranslate(java.lang.String dest, Dataset srcDS, VectorTranslateOptions options, ProgressCallback callback)
static int
VectorTranslate(Dataset dstDS, Dataset srcDS, VectorTranslateOptions options)
static int
VectorTranslate(Dataset dstDS, Dataset srcDS, VectorTranslateOptions options, ProgressCallback callback)
static java.lang.String
VersionInfo()
Get runtime version information.static java.lang.String
VersionInfo(java.lang.String request)
Get runtime version information.static Dataset
ViewshedGenerate(Band srcBand, java.lang.String driverName, java.lang.String targetRasterName, java.util.Vector creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, ViewshedMode mode, double maxDistance)
static Dataset
ViewshedGenerate(Band srcBand, java.lang.String driverName, java.lang.String targetRasterName, java.util.Vector creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, ViewshedMode mode, double maxDistance, ProgressCallback callback)
static Dataset
ViewshedGenerate(Band srcBand, java.lang.String driverName, java.lang.String targetRasterName, java.util.Vector creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, ViewshedMode mode, double maxDistance, ProgressCallback callback, ViewshedOutputType heightMode)
static Dataset
ViewshedGenerate(Band srcBand, java.lang.String driverName, java.lang.String targetRasterName, java.util.Vector creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, ViewshedMode mode, double maxDistance, ProgressCallback callback, ViewshedOutputType heightMode, java.util.Vector options)
static void
VSIErrorReset()
static java.lang.String
VSIGetLastErrorMsg()
static int
VSIGetLastErrorNo()
static Dataset
Warp(java.lang.String dest, Dataset[] object_list_count, WarpOptions warpAppOptions)
static Dataset
Warp(java.lang.String dest, Dataset[] object_list_count, WarpOptions warpAppOptions, ProgressCallback callback)
static int
Warp(Dataset dstDS, Dataset[] object_list_count, WarpOptions warpAppOptions)
static int
Warp(Dataset dstDS, Dataset[] object_list_count, WarpOptions warpAppOptions, ProgressCallback callback)
-
-
-
Method Detail
-
UseExceptions
public static void UseExceptions()
-
DontUseExceptions
public static void DontUseExceptions()
-
GetUseExceptions
public static boolean GetUseExceptions()
-
GeneralCmdLineProcessor
public static java.lang.String[] GeneralCmdLineProcessor(java.lang.String[] args, int options)
General utility option processing. This function is intended to provide a variety of generic commandline options for all GDAL commandline utilities. It takes care of the following commandline options:- --version: report version of GDAL in use.
- --license: report GDAL license info.
- --formats: report all format drivers configured.
- --format [format]: report details of one format driver.
- --optfile filename: expand an option file into the argument list.
- --config key value: set system configuration option.
- --debug [on/off/value]: set debug level.
- --mempreload dir: preload directory contents into /vsimem
- --help-general: report detailed help on general options.
The typical usage looks something like the following. Note that the formats should be registered so that the --formats and --format options will work properly.
public static void main( Strings[] args ) { gdal.AllRegister(); args = gdal.GeneralCmdLineProcessor( args, 0 ); }
- Parameters:
args
- the argument list arrayoptions
- currently unused- Returns:
- updated argument list array.
- Since:
- Java bindings 1.7.0
-
GeneralCmdLineProcessor
public static java.lang.String[] GeneralCmdLineProcessor(java.lang.String[] args)
General utility option processing. Same as below with options == 0- Since:
- Java bindings 1.7.0
- See Also:
GeneralCmdLineProcessor(String[] args, int options)
-
InvGeoTransform
public static double[] InvGeoTransform(double[] gt_in)
Invert Geotransform.This function will invert a standard 3x2 set of GeoTransform coefficients. This converts the equation from being pixel to geo to being geo to pixel.
- Parameters:
gt_in
- Input geotransform (allocated array of six doubles - unaltered).- Returns:
- an array of six doubles with the inverted geotransform on success or null if the equation is uninvertable.
- Since:
- Java bindings 1.7.0
-
GetMemFileBuffer
public static byte[] GetMemFileBuffer(java.lang.String fileName)
Fetch buffer underlying memory file. This function returns a byte[] array with a copy of the content of the memory buffer underlying a virtual "in memory" file. The original file is unmodified by this operation, and must be removed with Unlink(fileName) if necessary.- Parameters:
fileName
- filename (should begin with "/vsimem/")- Returns:
- file content
- Since:
- 3.10.1
- See Also:
Unlink(String fileName)
-
Debug
public static void Debug(java.lang.String msg_class, java.lang.String message)
Display a debugging message. The category argument is used in conjunction with the CPL_DEBUG environment variable to establish if the message should be displayed. If the CPL_DEBUG environment variable is not set, no debug messages are emitted (use Error(gdalconst.CE_Warning,...) to ensure messages are displayed). If CPL_DEBUG is set, but is an empty string or the word "ON" then all debug messages are shown. Otherwise only messages whose category appears somewhere within the CPL_DEBUG value are displayed (as determined by strstr()).Categories are usually an identifier for the subsystem producing the error. For instance "GDAL" might be used for the GDAL core, and "TIFF" for messages from the TIFF translator.
- Parameters:
msg_class
- name of the debugging message category.message
- message to display.
-
SetErrorHandler
public static int SetErrorHandler(SWIGTYPE_p_CPLErrorHandler pfnErrorHandler, SWIGTYPE_p_void user_data)
-
SetErrorHandler
public static int SetErrorHandler(SWIGTYPE_p_CPLErrorHandler pfnErrorHandler)
-
SetErrorHandler
public static int SetErrorHandler()
Set a quiet global error handler. This installs a quiet global error handler. Note; if a local handler is already installed with PushErrorHandler(), the global error handler will not be used until the last local handler is uninstalled with PopErrorHandler().- Since:
- Java bindings 1.10.0
-
SetCurrentErrorHandlerCatchDebug
public static void SetCurrentErrorHandlerCatchDebug(int bCatchDebug)
-
PushErrorHandler
public static int PushErrorHandler(java.lang.String callbackName)
Push a new error handler. This pushes a new error handler on the thread-local error handler stack. This handler will be used until removed with gdal.PopErrorHandler().- Parameters:
callbackName
- handler function name : "CPLQuietErrorHandler", "CPLDefaultErrorHandler", "CPLLoggingErrorHandler"
-
PushErrorHandler
public static int PushErrorHandler()
Push the quiet error handler. This pushes a new error handler on the thread-local error handler stack. This handler will be used until removed with gdal.PopErrorHandler().- Since:
- Java bindings 1.7.0
-
Error
public static void Error(int msg_class, int err_code, java.lang.String msg)
Report an error. This function reports an error in a manner that can be hooked and reported appropriate by different applications.The msg_class argument can have the value gdalconst.CE_Warning indicating that the message is an informational warning, gdalconst.CE_Failure indicating that the action failed, but that normal recover mechanisms will be used or CE_Fatal meaning that a fatal error has occurred, and that Error() should not return.
The default behavior of Error() is to report errors to stderr, and to abort() after reporting a gdalconst.CE_Fatal error. It is expected that some applications will want to suppress error reporting, and will want to install a C++ exception, or longjmp() approach to no local fatal error recovery.
Regardless of how application error handlers or the default error handler choose to handle an error, the error number, and message will be stored for recovery with gdal.GetLastErrorNo() and gdal.GetLastErrorMsg().
- Parameters:
msg_class
- one of gdalconst.CE_Warning, gdalconst.CE_Failure or gdalconst.CE_Fatal.err_code
- the error number (CPLE_*) from cpl_error.h.msg
- message to display..
-
GOA2GetAuthorizationURL
public static java.lang.String GOA2GetAuthorizationURL(java.lang.String pszScope)
-
GOA2GetRefreshToken
public static java.lang.String GOA2GetRefreshToken(java.lang.String pszAuthToken, java.lang.String pszScope)
-
GOA2GetAccessToken
public static java.lang.String GOA2GetAccessToken(java.lang.String pszRefreshToken, java.lang.String pszScope)
-
PopErrorHandler
public static void PopErrorHandler()
Pop error handler off stack.Discards the current error handler on the error handler stack, and restores the one in use before the last gdal.PushErrorHandler() call. This method has no effect if there are no error handlers on the current threads error handler stack.
-
ErrorReset
public static void ErrorReset()
Erase any traces of previous errors.This is normally used to ensure that an error which has been recovered from does not appear to be still in play with high level functions.
-
EscapeString
public static java.lang.String EscapeString(byte[] byteArray, int scheme)
Apply escaping to string to preserve special characters.- Since:
- Java bindings 1.7.0
- See Also:
EscapeString(String str, int scheme)
-
EscapeString
public static java.lang.String EscapeString(java.lang.String str, int scheme)
Apply escaping to string to preserve special characters. This function will "escape" a variety of special characters to make the string suitable to embed within a string constant or to write within a text stream but in a form that can be reconstituted to it's original form. The escaping will even preserve zero bytes allowing preservation of raw binary data.- gdalconst.CPLES_BackslashQuotable(0): This scheme turns a binary string into a form suitable to be placed within double quotes as a string constant. The backslash, quote, '\\0' and newline characters are all escaped in the usual C style.
- gdalconst.CPLES_XML(1): This scheme converts the '<', '>' and '&' characters into their XML/HTML equivalent (>, < and &) making a string safe to embed as CDATA within an XML element. The '\\0' is not escaped and should not be included in the input.
- gdalconst.CPLES_URL(2): Everything except alphanumerics and the underscore are converted to a percent followed by a two digit hex encoding of the character (leading zero supplied if needed). This is the mechanism used for encoding values to be passed in URLs.
- gdalconst.CPLES_SQL(3): All single quotes are replaced with two single quotes. Suitable for use when constructing literal values for SQL commands where the literal will be enclosed in single quotes.
- gdalconst.CPLES_CSV(4): If the values contains commas, double quotes, or newlines it placed in double quotes, and double quotes in the value are doubled. Suitable for use when constructing field values for .csv files. Note that gdal.UnescapeString() currently does not support this format, only gdal.EscapeString(). See cpl_csv.cpp for csv parsing support.
- Parameters:
str
- the string to escape.scheme
- the encoding scheme to use.- Returns:
- an escaped string
- Since:
- Java bindings 1.7.0
-
GetLastErrorNo
public static int GetLastErrorNo()
Fetch the last error number.This is the error number, not the error class.
- Returns:
- the error number of the last error to occur, or gdalconst.CPLE_None (0) if there are no posted errors.
-
GetLastErrorType
public static int GetLastErrorType()
Fetch the last error type.This is the error class, not the error number.
- Returns:
- the error number of the last error to occur, or gdalconst.CE_None (0) if there are no posted errors.
-
GetLastErrorMsg
public static java.lang.String GetLastErrorMsg()
Get the last error message.Fetches the last error message posted with CPLError(), that hasn't been cleared by gdal.ErrorReset().
- Returns:
- the last error message, or null if there is no posted error message.
-
GetErrorCounter
public static long GetErrorCounter()
-
VSIGetLastErrorNo
public static int VSIGetLastErrorNo()
-
VSIGetLastErrorMsg
public static java.lang.String VSIGetLastErrorMsg()
-
VSIErrorReset
public static void VSIErrorReset()
-
PushFinderLocation
public static void PushFinderLocation(java.lang.String utf8_path)
-
PopFinderLocation
public static void PopFinderLocation()
-
FinderClean
public static void FinderClean()
-
FindFile
public static java.lang.String FindFile(java.lang.String pszClass, java.lang.String utf8_path)
-
ReadDir
public static java.util.Vector ReadDir(java.lang.String utf8_path, int nMaxFiles)
-
ReadDir
public static java.util.Vector ReadDir(java.lang.String path)
Read names in a directory.This function abstracts access to directory contains. It returns a list of strings containing the names of files, and directories in this directory.
Note that no error is issued via CPLError() if the directory path is invalid, though null is returned.
- Parameters:
path
- the relative, or absolute path of a directory to read.- Returns:
- The list of entries in the directory, or null if the directory doesn't exist.
- Since:
- Java bindings 1.7.0
-
ReadDirRecursive
public static java.util.Vector ReadDirRecursive(java.lang.String utf8_path)
-
SetConfigOption
public static void SetConfigOption(java.lang.String key, java.lang.String value)
Set a configuration option for GDAL/OGR use.Those options are defined as a (key, value) couple. The value corresponding to a key can be got later with the gdal.GetConfigOption() method.
This mechanism is similar to environment variables, but options set with gdal.SetConfigOption() overrides, for gdal.GetConfigOption() point of view, values defined in the environment.
If gdal.SetConfigOption() is called several times with the same key, the value provided during the last call will be used.
Options can also be passed on the command line of most GDAL utilities with the with '--config KEY VALUE'. For example, ogrinfo --config CPL_DEBUG ON ~/data/test/point.shp
- Parameters:
key
- the key of the optionvalue
- the value of the option- See Also:
GetConfigOption(java.lang.String, java.lang.String)
-
SetThreadLocalConfigOption
public static void SetThreadLocalConfigOption(java.lang.String pszKey, java.lang.String pszValue)
-
GetConfigOption
public static java.lang.String GetConfigOption(java.lang.String key, java.lang.String defaultValue)
Get the value of a configuration option.The value is the value of a (key, value) option set with gdal.SetConfigOption(). If the given option was no defined with gdal.SetConfigOption(), it tries to find it in environment variables.
- Parameters:
key
- the key of the option to retrievedefaultValue
- a default value if the key does not match existing defined options (may be null)- Returns:
- the value associated to the key, or the default value if not found
- See Also:
SetConfigOption(java.lang.String, java.lang.String)
-
GetConfigOption
public static java.lang.String GetConfigOption(java.lang.String key)
Get the value of a configuration option.Same as below with defaultValue == null
- Since:
- Java bindings 1.7.0
- See Also:
GetConfigOption(String key, String defaultValue)
-
GetGlobalConfigOption
public static java.lang.String GetGlobalConfigOption(java.lang.String pszKey, java.lang.String pszDefault)
-
GetGlobalConfigOption
public static java.lang.String GetGlobalConfigOption(java.lang.String pszKey)
-
GetThreadLocalConfigOption
public static java.lang.String GetThreadLocalConfigOption(java.lang.String pszKey, java.lang.String pszDefault)
-
GetThreadLocalConfigOption
public static java.lang.String GetThreadLocalConfigOption(java.lang.String pszKey)
-
GetConfigOptions
public static java.util.Hashtable GetConfigOptions()
-
SetPathSpecificOption
public static void SetPathSpecificOption(java.lang.String pszPathPrefix, java.lang.String pszKey, java.lang.String pszValue)
-
SetCredential
public static void SetCredential(java.lang.String pszPathPrefix, java.lang.String pszKey, java.lang.String pszValue)
-
GetCredential
public static java.lang.String GetCredential(java.lang.String pszPathPrefix, java.lang.String pszKey, java.lang.String pszDefault)
-
GetCredential
public static java.lang.String GetCredential(java.lang.String pszPathPrefix, java.lang.String pszKey)
-
GetPathSpecificOption
public static java.lang.String GetPathSpecificOption(java.lang.String pszPathPrefix, java.lang.String pszKey, java.lang.String pszDefault)
-
GetPathSpecificOption
public static java.lang.String GetPathSpecificOption(java.lang.String pszPathPrefix, java.lang.String pszKey)
-
ClearCredentials
public static void ClearCredentials(java.lang.String pszPathPrefix)
-
ClearCredentials
public static void ClearCredentials()
-
ClearPathSpecificOptions
public static void ClearPathSpecificOptions(java.lang.String pszPathPrefix)
-
ClearPathSpecificOptions
public static void ClearPathSpecificOptions()
-
CPLBinaryToHex
public static java.lang.String CPLBinaryToHex(byte[] nBytes)
-
CPLHexToBinary
public static byte[] CPLHexToBinary(java.lang.String pszHex)
-
FileFromMemBuffer
public static int FileFromMemBuffer(java.lang.String utf8_path, byte[] nBytes)
-
Unlink
public static int Unlink(java.lang.String fileName)
Delete a file.Deletes a file object from the file system. This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.
Analog of the POSIX unlink() function.
- Parameters:
fileName
- the path of the file to be deleted.- Returns:
- 0 on success or -1 on an error.
- Since:
- Java bindings 1.7.0
- See Also:
FileFromMemBuffer(String fileName, byte[] byteArray)
-
UnlinkBatch
public static boolean UnlinkBatch(java.util.Vector files)
-
Mkdir
public static int Mkdir(java.lang.String path, int mode)
Create a directory.Create a new directory with the indicated mode. The mode is ignored on some platforms. A reasonable default mode value would be 0666. This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.
Analog of the POSIX mkdir() function.
- Parameters:
path
- the path to the directory to create.mode
- the permissions mode.- Returns:
- 0 on success or -1 on an error.
- Since:
- Java bindings 1.8.0
-
Rmdir
public static int Rmdir(java.lang.String path)
Delete a directory.Deletes a directory object from the file system. On some systems the directory must be empty before it can be deleted.
This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.
Analog of the POSIX rmdir() function.
- Parameters:
path
- the path of the directory to be deleted.- Returns:
- 0 on success or -1 on an error.
- Since:
- Java bindings 1.8.0
-
MkdirRecursive
public static int MkdirRecursive(java.lang.String utf8_path, int mode)
-
RmdirRecursive
public static int RmdirRecursive(java.lang.String utf8_path)
-
Rename
public static int Rename(java.lang.String oldpath, java.lang.String newpath)
Rename a file.Renames a file object in the file system. It should be possible to rename a file onto a new filesystem, but it is safest if this function is only used to rename files that remain in the same directory.
This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.
Analog of the POSIX rename() function.
- Parameters:
oldpath
- the name of the file to be renamed.newpath
- the name the file should be given.- Returns:
- 0 on success or -1 on an error.
- Since:
- Java bindings 1.8.0
-
CopyFile
public static int CopyFile(java.lang.String pszSource, java.lang.String pszTarget, SWIGTYPE_p_VSILFILE fpSource, long nSourceSize, java.util.Vector options, ProgressCallback callback)
-
CopyFile
public static int CopyFile(java.lang.String pszSource, java.lang.String pszTarget, SWIGTYPE_p_VSILFILE fpSource, long nSourceSize, java.util.Vector options)
-
CopyFile
public static int CopyFile(java.lang.String pszSource, java.lang.String pszTarget, SWIGTYPE_p_VSILFILE fpSource, long nSourceSize)
-
CopyFile
public static int CopyFile(java.lang.String pszSource, java.lang.String pszTarget, SWIGTYPE_p_VSILFILE fpSource)
-
CopyFile
public static int CopyFile(java.lang.String pszSource, java.lang.String pszTarget)
-
GetActualURL
public static java.lang.String GetActualURL(java.lang.String utf8_path)
-
GetSignedURL
public static java.lang.String GetSignedURL(java.lang.String utf8_path, java.util.Vector options)
-
GetSignedURL
public static java.lang.String GetSignedURL(java.lang.String utf8_path)
-
GetFileSystemsPrefixes
public static java.util.Vector GetFileSystemsPrefixes()
-
GetFileSystemOptions
public static java.lang.String GetFileSystemOptions(java.lang.String utf8_path)
-
ParseCommandLine
public static java.util.Vector ParseCommandLine(java.lang.String utf8_path)
-
GetNumCPUs
public static int GetNumCPUs()
-
GetUsablePhysicalRAM
public static long GetUsablePhysicalRAM()
-
GDAL_GCP_GCPX_get
public static double GDAL_GCP_GCPX_get(GCP gcp)
-
GDAL_GCP_GCPX_set
public static void GDAL_GCP_GCPX_set(GCP gcp, double dfGCPX)
-
GDAL_GCP_GCPY_get
public static double GDAL_GCP_GCPY_get(GCP gcp)
-
GDAL_GCP_GCPY_set
public static void GDAL_GCP_GCPY_set(GCP gcp, double dfGCPY)
-
GDAL_GCP_GCPZ_get
public static double GDAL_GCP_GCPZ_get(GCP gcp)
-
GDAL_GCP_GCPZ_set
public static void GDAL_GCP_GCPZ_set(GCP gcp, double dfGCPZ)
-
GDAL_GCP_GCPPixel_get
public static double GDAL_GCP_GCPPixel_get(GCP gcp)
-
GDAL_GCP_GCPPixel_set
public static void GDAL_GCP_GCPPixel_set(GCP gcp, double dfGCPPixel)
-
GDAL_GCP_GCPLine_get
public static double GDAL_GCP_GCPLine_get(GCP gcp)
-
GDAL_GCP_GCPLine_set
public static void GDAL_GCP_GCPLine_set(GCP gcp, double dfGCPLine)
-
GDAL_GCP_Info_get
public static java.lang.String GDAL_GCP_Info_get(GCP gcp)
-
GDAL_GCP_Info_set
public static void GDAL_GCP_Info_set(GCP gcp, java.lang.String pszInfo)
-
GDAL_GCP_Id_get
public static java.lang.String GDAL_GCP_Id_get(GCP gcp)
-
GDAL_GCP_Id_set
public static void GDAL_GCP_Id_set(GCP gcp, java.lang.String pszId)
-
GCPsToGeoTransform
public static int GCPsToGeoTransform(GCP[] gcpArray, double[] outGeoTransform, int bApproxOK)
Generate Geotransform from GCPs.Given a set of GCPs perform first order fit as a geotransform.
Due to imprecision in the calculations the fit algorithm will often return non-zero rotational coefficients even if given perfectly non-rotated inputs. A special case has been implemented for corner corner coordinates given in TL, TR, BR, BL order. So when using this to get a geotransform from 4 corner coordinates, pass them in this order.
- Parameters:
gcpArray
- the array of GCP.outGeoTransform
- the six double array in which the affine geotransformation will be returned.bApproxOK
- If 0 the function will fail if the geotransform is not essentially an exact fit (within 0.25 pixel) for all GCPs.- Returns:
- 1 on success or 0 if there aren't enough points to prepare a geotransform, the pointers are ill-determined or if bApproxOK is 0 and the fit is poor.
- Since:
- Java bindings 1.7.0
-
GCPsToGeoTransform
public static int GCPsToGeoTransform(GCP[] gcpArray, double[] outGeoTransform)
Generate Geotransform from GCPs.Same as below with bApproxOK == 0
- Since:
- Java bindings 1.7.0
- See Also:
GCPsToGeoTransform(GCP[] gcpArray, double[] outGeoTransform, int bApproxOK)
-
GetSubdatasetInfo
public static SWIGTYPE_p_GDALSubdatasetInfo GetSubdatasetInfo(java.lang.String pszFileName)
-
ComputeMedianCutPCT
public static int ComputeMedianCutPCT(Band red, Band green, Band blue, int num_colors, ColorTable colors, ProgressCallback callback)
Compute optimal PCT for RGB image.This function implements a median cut algorithm to compute an "optimal" pseudocolor table for representing an input RGB image. This PCT could then be used with GDALDitherRGB2PCT() to convert a 24bit RGB image into an eightbit pseudo-colored image.
This code was based on the tiffmedian.c code from libtiff (www.libtiff.org) which was based on a paper by Paul Heckbert:
"Color Image Quantization for Frame Buffer Display", Paul Heckbert, SIGGRAPH proceedings, 1982, pp. 297-307.
The red, green and blue input bands do not necessarily need to come from the same file, but they must be the same width and height. They will be clipped to 8bit during reading, so non-eight bit bands are generally inappropriate.
- Parameters:
red
- Red input band.green
- Green input band.blue
- Blue input band.num_colors
- the desired number of colors to be returned (2-256).colors
- the color table will be returned in this color table object.callback
- for reporting algorithm progress. May be null- Returns:
- returns gdalconst.CE_None on success or gdalconst.CE_Failure if an error occurs.
- Since:
- Java bindings 1.7.0
-
ComputeMedianCutPCT
public static int ComputeMedianCutPCT(Band red, Band green, Band blue, int num_colors, ColorTable colors)
Compute optimal PCT for RGB image.Same as below with callback == null
- Since:
- Java bindings 1.7.0
- See Also:
ComputeMedianCutPCT(Band red, Band green, Band blue, int num_colors, ColorTable colors, ProgressCallback callback)
-
DitherRGB2PCT
public static int DitherRGB2PCT(Band red, Band green, Band blue, Band target, ColorTable colors, ProgressCallback callback)
24bit to 8bit conversion with dithering.This functions utilizes Floyd-Steinberg dithering in the process of converting a 24bit RGB image into a pseudocolored 8bit image using a provided color table.
The red, green and blue input bands do not necessarily need to come from the same file, but they must be the same width and height. They will be clipped to 8bit during reading, so non-eight bit bands are generally inappropriate. Likewise the hTarget band will be written with 8bit values and must match the width and height of the source bands.
The color table cannot have more than 256 entries.
- Parameters:
red
- Red input band.green
- Green input band.blue
- Blue input band.target
- Output band.colors
- the color table to use with the output band.callback
- for reporting algorithm progress. May be null- Returns:
- gdalconst.CE_None on success or gdalconst.CE_Failure if an error occurs.
- Since:
- Java bindings 1.7.0
-
DitherRGB2PCT
public static int DitherRGB2PCT(Band red, Band green, Band blue, Band target, ColorTable colors)
24bit to 8bit conversion with dithering.Same as below with callback == null
- Since:
- Java bindings 1.7.0
- See Also:
DitherRGB2PCT(Band red, Band green, Band blue, Band target, ColorTable colors, ProgressCallback callback)
-
ReprojectImage
public static int ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int eResampleAlg, double WarpMemoryLimit, double maxerror, ProgressCallback callback, java.util.Vector options)
-
ReprojectImage
public static int ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int resampleAlg, double warpMemoryLimit, double maxError, ProgressCallback callback)
Reproject image.This is a convenience function utilizing the GDALWarpOperation class to reproject an image from a source to a destination. In particular, this function takes care of establishing the transformation function to implement the reprojection, and will default a variety of other warp options.
By default all bands are transferred, with no masking or nodata values in effect. No metadata, projection info, or color tables are transferred to the output file.
- Parameters:
src_ds
- the source image file.dst_ds
- the destination image file.src_wkt
- the source projection. If null the source projection is read from from src_ds.dst_wkt
- the destination projection. If null the destination projection will be read from dst_ds.resampleAlg
- the type of resampling to use. (among gdalconst.GRA_*)warpMemoryLimit
- the amount of memory (in bytes) that the warp API is allowed to use for caching. This is in addition to the memory already allocated to the GDAL caching (as per gdal.SetCacheMax()). May be 0.0 to use default memory settings.maxError
- maximum error measured in input pixels that is allowed in approximating the transformation (0.0 for exact calculations).callback
- for reporting progress or null- Returns:
- gdalconst.CE_None on success or gdalconst.CE_Failure if something goes wrong.
- Since:
- Java bindings 1.7.0
-
ReprojectImage
public static int ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int resampleAlg, double warpMemoryLimit, double maxError)
Reproject image.Same as below with callback == null.
- Returns:
- gdalconst.CE_None on success or gdalconst.CE_Failure if something goes wrong.
- Since:
- Java bindings 1.7.0
- See Also:
ReprojectImage(Dataset src_ds, Dataset dst_ds, String src_wkt, String dst_wkt, int resampleAlg, double warpMemoryLimit, double maxError, ProgressCallback callback)
-
ReprojectImage
public static int ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int resampleAlg, double warpMemoryLimit)
Reproject image.Same as below with maxError == 0.0 and callback == null.
-
ReprojectImage
public static int ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int resampleAlg)
Reproject image.Same as below with warpMemoryLimit == 0.0, maxError == 0.0 and callback == null.
-
ReprojectImage
public static int ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt, java.lang.String dst_wkt)
Reproject image.Same as below with resampleAlg == gdalconst.GRA_NearestNeighbour, warpMemoryLimit == 0.0, maxError == 0.0 and callback == null.
-
ReprojectImage
public static int ReprojectImage(Dataset src_ds, Dataset dst_ds, java.lang.String src_wkt)
Reproject image.Same as below with dst_wkt == null, resampleAlg == gdalconst.GRA_NearestNeighbour, warpMemoryLimit == 0.0, maxError == 0.0 and callback == null.
-
ReprojectImage
public static int ReprojectImage(Dataset src_ds, Dataset dst_ds)
Reproject image.Same as below with src_wkt == null, dst_wkt == null, resampleAlg == gdalconst.GRA_NearestNeighbour, warpMemoryLimit == 0.0, maxError == 0.0 and callback == null.
-
ComputeProximity
public static int ComputeProximity(Band srcBand, Band proximityBand, java.util.Vector options, ProgressCallback callback)
Compute the proximity of all pixels in the image to a set of pixels in the source image.The following options are used to define the behavior of the function. By default all non-zero pixels in srcBand will be considered the "target", and all proximities will be computed in pixels. Note that target pixels are set to the value corresponding to a distance of zero.
Options:
- VALUES=n[,n]*
- A list of target pixel values to measure the distance from. If this option is not provided proximity will be computed from non-zero pixel values. Currently pixel values are internally processed as integers.
- DISTUNITS=[PIXEL]/GEO
- Indicates whether distances will be computed in pixel units or in georeferenced units. The default is pixel units. This also determines the interpretation of MAXDIST.
- MAXDIST=n
- The maximum distance to search. Proximity distances greater than this value will not be computed. Instead output pixels will be set to a nodata value.
- NODATA=n
- The NODATA value to use on the output band for pixels that are beyond MAXDIST. If not provided, the hProximityBand will be queried for a nodata value. If one is not found, 65535 will be used.
- FIXED_BUF_VAL=n
- If this option is set, all pixels within the MAXDIST threadhold are set to this fixed value instead of to a proximity distance.
- Parameters:
srcBand
- the source bandproximityBand
- the destination bandoptions
- a vector of strings with the above optionscallback
- for reporting progress or null- Returns:
- gdalconst.CE_None on success or gdalconst.CE_Failure if something goes wrong.
- Since:
- Java bindings 1.7.0
-
ComputeProximity
public static int ComputeProximity(Band srcBand, Band proximityBand, java.util.Vector options)
Compute the proximity of all pixels in the image to a set of pixels in the source image.Same as below with callback = null
- Since:
- Java bindings 1.7.0
- See Also:
ComputeProximity(Band srcBand, Band proximityBand, java.util.Vector options, ProgressCallback callback)
-
ComputeProximity
public static int ComputeProximity(Band srcBand, Band proximityBand)
Compute the proximity of all pixels in the image to a set of pixels in the source image.Same as below with options == null and callback == null
- Since:
- Java bindings 1.7.0
- See Also:
ComputeProximity(Band srcBand, Band proximityBand, java.util.Vector options, ProgressCallback callback)
-
RasterizeLayer
public static int RasterizeLayer(Dataset dataset, int[] bands, Layer layer, double[] burn_values, java.util.Vector options, ProgressCallback callback)
-
RasterizeLayer
public static int RasterizeLayer(Dataset dataset, int[] bands, Layer layer, double[] burn_values, java.util.Vector options)
-
RasterizeLayer
public static int RasterizeLayer(Dataset dataset, int[] bands, Layer layer, double[] burn_values)
-
Polygonize
public static int Polygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, java.util.Vector options, ProgressCallback callback)
-
Polygonize
public static int Polygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, java.util.Vector options)
-
Polygonize
public static int Polygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField)
-
FPolygonize
public static int FPolygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, java.util.Vector options, ProgressCallback callback)
-
FPolygonize
public static int FPolygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, java.util.Vector options)
-
FPolygonize
public static int FPolygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField)
-
FillNodata
public static int FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations, java.util.Vector options, ProgressCallback callback)
Fill selected raster regions by interpolation from the edges.This algorithm will interpolate values for all designated nodata pixels (marked by zeros in maskBand). For each pixel a four direction conic search is done to find values to interpolate from (using inverse distance weighting). Once all values are interpolated, zero or more smoothing iterations (3x3 average filters on interpolated pixels) are applied to smooth out artifacts.
This algorithm is generally suitable for interpolating missing regions of fairly continuously varying rasters (such as elevation models for instance). It is also suitable for filling small holes and cracks in more irregularly varying images (like airphotos). It is generally not so great for interpolating a raster from sparse point data - see the algorithms defined in gdal_grid.h for that case.
- Parameters:
targetBand
- the raster band to be modified in place.maskBand
- a mask band indicating pixels to be interpolated (zero valuedmaxSearchDist
- the maximum number of pixels to search in all directions to find values to interpolate from.smoothingIterations
- the number of 3x3 smoothing filter passes to run (0 or more).options
- additional name=value options in a string list (none supported at this time - just pass null).callback
- for reporting progress or null- Returns:
- gdalconst.CE_None on success or gdalconst.CE_Failure on a failure.
- Since:
- Java bindings 1.7.0
-
FillNodata
public static int FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations, java.util.Vector options)
Fill selected raster regions by interpolation from the edges.Same as below with callback == null
- Since:
- Java bindings 1.7.0
- See Also:
FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations, java.util.Vector options, ProgressCallback callback)
-
FillNodata
public static int FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations)
Fill selected raster regions by interpolation from the edges.Same as below with options == null and callback == null
- Since:
- Java bindings 1.7.0
- See Also:
FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations, java.util.Vector options, ProgressCallback callback)
-
SieveFilter
public static int SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness, java.util.Vector options, ProgressCallback callback)
Removes small raster polygons.The function removes raster polygons smaller than a provided threshold size (in pixels) and replaces them with the pixel value of the largest neighbour polygon.
Polygon are determined (per GDALRasterPolygonEnumerator) as regions of the raster where the pixels all have the same value, and that are contiguous (connected).
Pixels determined to be "nodata" per maskBand will not be treated as part of a polygon regardless of their pixel values. Nodata areas will never be changed nor affect polygon sizes.
Polygons smaller than the threshold with no neighbours that are as large as the threshold will not be altered. Polygons surrounded by nodata areas will therefore not be altered.
The algorithm makes three passes over the input file to enumerate the polygons and collect limited information about them. Memory use is proportional to the number of polygons (roughly 24 bytes per polygon), but is not directly related to the size of the raster. So very large raster files can be processed effectively if there aren't too many polygons. But extremely noisy rasters with many one pixel polygons will end up being expensive (in memory) to process.
- Parameters:
srcBand
- the source raster band to be processed.maskBand
- an optional mask band. All pixels in the mask band with a value other than zero will be considered suitable for inclusion in polygons.dstBand
- the output raster band. It may be the same as srcBand to update the source in place.threshold
- raster polygons with sizes smaller than this will be merged into their largest neighbour.connectedness
- either 4 indicating that diagonal pixels are not considered directly adjacent for polygon membership purposes or 8 indicating they are.options
- algorithm options in name=value list form. None currently supported. just pass nullcallback
- for reporting progress or null- Returns:
- gdalconst.CE_None on success or gdalconst.CE_Failure on a failure.
- Since:
- Java bindings 1.7.0
-
SieveFilter
public static int SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness, java.util.Vector options)
Removes small raster polygons.Same as below with callback == null
- Since:
- Java bindings 1.7.0
- See Also:
SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness, java.util.Vector options, ProgressCallback callback)
-
SieveFilter
public static int SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness)
Removes small raster polygons.Same as below with options == null and callback == null
- Since:
- Java bindings 1.7.0
- See Also:
SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness, java.util.Vector options, ProgressCallback callback)
-
SieveFilter
public static int SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold)
Removes small raster polygons.Same as below with connectedness == 4, options == null and callback == null
- Since:
- Java bindings 1.7.0
- See Also:
SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness, java.util.Vector options, ProgressCallback callback)
-
RegenerateOverviews
public static int RegenerateOverviews(Band srcBand, Band[] overviewBands, java.lang.String resampling, ProgressCallback callback)
Generate downsampled overviews.This function will generate one or more overview images from a base image using the requested downsampling algorithm. It's primary use is for generating overviews via Dataset.BuildOverviews(), but it can also be used to generate downsampled images in one file from another outside the overview architecture.
The output bands need to exist in advance.
The full set of resampling algorithms is documented in Dataset.BuildOverviews().
- Parameters:
srcBand
- the source (base level) band.overviewBands
- the list of downsampled bands to be generated.resampling
- Resampling algorithm (eg. "AVERAGE").callback
- for reporting progress or null- Returns:
- gdalconst.CE_None on success or gdalconst.CE_Failure on a failure.
- Since:
- Java bindings 1.7.0
- See Also:
Dataset.BuildOverviews(java.lang.String resampling, int[] overviewlist, ProgressCallback callback)
-
RegenerateOverviews
public static int RegenerateOverviews(Band srcBand, Band[] overviewBands, java.lang.String resampling)
Generate downsampled overviews.Same as below with callback == null
- Since:
- Java bindings 1.7.0
- See Also:
RegenerateOverviews(Band srcBand, Band[] overviewBands, String resampling, ProgressCallback callback)
-
RegenerateOverviews
public static int RegenerateOverviews(Band srcBand, Band[] overviewBands)
Generate downsampled overviews.Same as below with resampling == "AVERAGE" and callback == null
- Since:
- Java bindings 1.7.0
- See Also:
RegenerateOverviews(Band srcBand, Band[] overviewBands, String resampling, ProgressCallback callback)
-
RegenerateOverview
public static int RegenerateOverview(Band srcBand, Band overviewBand, java.lang.String resampling, ProgressCallback callback)
Generate downsampled overview.Same as below for a unique overview band
- Since:
- Java bindings 1.7.0
- See Also:
RegenerateOverviews(Band srcBand, Band[] overviewBands, String resampling, ProgressCallback callback)
-
RegenerateOverview
public static int RegenerateOverview(Band srcBand, Band overviewBand, java.lang.String resampling)
Generate downsampled overview.Same as below for a unique overview band and callback == null
- Since:
- Java bindings 1.7.0
- See Also:
RegenerateOverviews(Band srcBand, Band[] overviewBands, String resampling, ProgressCallback callback)
-
RegenerateOverview
public static int RegenerateOverview(Band srcBand, Band overviewBand)
Generate downsampled overview.Same as below for a unique overview band, resampling == "AVERAGE" and callback == null
- Since:
- Java bindings 1.7.0
- See Also:
RegenerateOverviews(Band srcBand, Band[] overviewBands, String resampling, ProgressCallback callback)
-
GridCreate
public static int GridCreate(java.lang.String algorithmOptions, double[][] points, double xMin, double xMax, double yMin, double yMax, int xSize, int ySize, int dataType, java.nio.ByteBuffer nioBuffer, ProgressCallback callback)
-
GridCreate
public static int GridCreate(java.lang.String algorithmOptions, double[][] points, double xMin, double xMax, double yMin, double yMax, int xSize, int ySize, int dataType, java.nio.ByteBuffer nioBuffer)
-
ContourGenerate
public static int ContourGenerate(Band srcBand, double contourInterval, double contourBase, double[] fixedLevelCount, int useNoData, double noDataValue, Layer dstLayer, int idField, int elevField, ProgressCallback callback)
-
ContourGenerate
public static int ContourGenerate(Band srcBand, double contourInterval, double contourBase, double[] fixedLevelCount, int useNoData, double noDataValue, Layer dstLayer, int idField, int elevField)
-
ContourGenerateEx
public static int ContourGenerateEx(Band srcBand, Layer dstLayer, java.util.Vector options, ProgressCallback callback)
-
ContourGenerateEx
public static int ContourGenerateEx(Band srcBand, Layer dstLayer, java.util.Vector options)
-
ViewshedGenerate
public static Dataset ViewshedGenerate(Band srcBand, java.lang.String driverName, java.lang.String targetRasterName, java.util.Vector creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, ViewshedMode mode, double maxDistance, ProgressCallback callback, ViewshedOutputType heightMode, java.util.Vector options)
-
ViewshedGenerate
public static Dataset ViewshedGenerate(Band srcBand, java.lang.String driverName, java.lang.String targetRasterName, java.util.Vector creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, ViewshedMode mode, double maxDistance, ProgressCallback callback, ViewshedOutputType heightMode)
-
ViewshedGenerate
public static Dataset ViewshedGenerate(Band srcBand, java.lang.String driverName, java.lang.String targetRasterName, java.util.Vector creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, ViewshedMode mode, double maxDistance, ProgressCallback callback)
-
ViewshedGenerate
public static Dataset ViewshedGenerate(Band srcBand, java.lang.String driverName, java.lang.String targetRasterName, java.util.Vector creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, ViewshedMode mode, double maxDistance)
-
IsLineOfSightVisible
public static boolean IsLineOfSightVisible(Band band, int xA, int yA, double zA, int xB, int yB, double zB, java.util.Vector options)
-
IsLineOfSightVisible
public static boolean IsLineOfSightVisible(Band band, int xA, int yA, double zA, int xB, int yB, double zB)
-
AutoCreateWarpedVRT
public static Dataset AutoCreateWarpedVRT(Dataset src_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int eResampleAlg, double maxError)
Create virtual warped dataset automatically.This function will create a warped virtual file representing the input image warped into the target coordinate system. A GenImgProj transformation is created to accomplish any required GCP/Geotransform warp and reprojection to the target coordinate system. The output virtual dataset will be "northup" in the target coordinate system. The GDALSuggestedWarpOutput() function is used to determine the bounds and resolution of the output virtual file which should be large enough to include all the input image
Note that the constructed Dataset object will acquire one or more references to the passed in src_ds. Reference counting semantics on the source dataset should be honoured. That is, don't just GDALClose() it unless it was opened with GDALOpenShared().
The returned dataset will have no associated filename for itself. If you want to write the virtual dataset description to a file, use the SetDescription() method on the dataset to assign a filename before it is closed.
- Parameters:
src_ds
- The source dataset.src_wkt
- The coordinate system of the source image. If null, it will be read from the source image.dst_wkt
- The coordinate system to convert to. If null no change of coordinate system will take place.eResampleAlg
- One of gdalconst.GRA_NearestNeighbour, gdalconst.GRA_Bilinear, gdalconst.GRA_Cubic or gdalconst.RA_CubicSpline. Controls the sampling method used.maxError
- Maximum error measured in input pixels that is allowed in approximating the transformation (0.0 for exact calculations).- Returns:
- null on failure, or a new virtual dataset handle on success.
-
AutoCreateWarpedVRT
public static Dataset AutoCreateWarpedVRT(Dataset src_ds, java.lang.String src_wkt, java.lang.String dst_wkt, int eResampleAlg)
Create virtual warped dataset automatically.Same as below with maxError == 0.0
- Since:
- Java bindings 1.7.0
- See Also:
AutoCreateWarpedVRT(Dataset src_ds, String src_wkt, String dst_wkt, int eResampleAlg, double maxError)
-
AutoCreateWarpedVRT
public static Dataset AutoCreateWarpedVRT(Dataset src_ds, java.lang.String src_wkt, java.lang.String dst_wkt)
Create virtual warped dataset automatically.Same as below with eResampleAlg == gdalconst.GRA_NearestNeighbour and maxError == 0.0
- Since:
- Java bindings 1.7.0
- See Also:
AutoCreateWarpedVRT(Dataset src_ds, String src_wkt, String dst_wkt, int eResampleAlg, double maxError)
-
AutoCreateWarpedVRT
public static Dataset AutoCreateWarpedVRT(Dataset src_ds, java.lang.String src_wkt)
Create virtual warped dataset automatically.Same as below with dst_wkt == null, eResampleAlg == gdalconst.GRA_NearestNeighbour and maxError == 0.0
- Since:
- Java bindings 1.7.0
- See Also:
AutoCreateWarpedVRT(Dataset src_ds, String src_wkt, String dst_wkt, int eResampleAlg, double maxError)
-
AutoCreateWarpedVRT
public static Dataset AutoCreateWarpedVRT(Dataset src_ds)
Create virtual warped dataset automatically.Same as below with src_wkt == null, dst_wkt == null, eResampleAlg == gdalconst.GRA_NearestNeighbour and maxError == 0.0
- Since:
- Java bindings 1.7.0
- See Also:
AutoCreateWarpedVRT(Dataset src_ds, String src_wkt, String dst_wkt, int eResampleAlg, double maxError)
-
CreatePansharpenedVRT
public static Dataset CreatePansharpenedVRT(java.lang.String pszXML, Band panchroBand, Band[] nInputSpectralBands)
-
SuggestedWarpOutput
public static SuggestedWarpOutputRes SuggestedWarpOutput(Dataset src, Transformer transformer)
-
SuggestedWarpOutput
public static SuggestedWarpOutputRes SuggestedWarpOutput(Dataset src, java.util.Vector options)
-
ApplyVerticalShiftGrid
public static Dataset ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, boolean inverse, double srcUnitToMeter, double dstUnitToMeter, java.util.Vector options)
-
ApplyVerticalShiftGrid
public static Dataset ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, boolean inverse, double srcUnitToMeter, double dstUnitToMeter)
-
ApplyVerticalShiftGrid
public static Dataset ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, boolean inverse, double srcUnitToMeter)
-
ApplyVerticalShiftGrid
public static Dataset ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, boolean inverse)
-
ApplyVerticalShiftGrid
public static Dataset ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds)
-
ApplyGeoTransform
public static void ApplyGeoTransform(double[] padfGeoTransform, double dfPixel, double dfLine, double[] pdfGeoX, double[] pdfGeoY)
Apply GeoTransform to x/y coordinate.Applies the following computation, converting a (pixel,line) coordinate into a georeferenced (geo_x,geo_y) location.
pdfGeoX[0] = padfGeoTransform[0] + dfPixel * padfGeoTransform[1] + dfLine * padfGeoTransform[2]; pdfGeoY[0] = padfGeoTransform[3] + dfPixel * padfGeoTransform[4] + dfLine * padfGeoTransform[5];
- Parameters:
padfGeoTransform
- Six coefficient GeoTransform to apply.dfPixel
- Input pixel positiondfLine
- Input line position.pdfGeoX
- allocated array of 1 double where geo_x (easting/longitude) location is placed.pdfGeoY
- allocated array of 1 double where geo_y (northing/latitude) location is placed.- Since:
- Java bindings 1.7.0
-
InvGeoTransform
public static int InvGeoTransform(double[] gt_in, double[] gt_out)
Invert Geotransform.This function will invert a standard 3x2 set of GeoTransform coefficients. This converts the equation from being pixel to geo to being geo to pixel.
- Parameters:
gt_in
- Input geotransform (allocated array of six doubles - unaltered).gt_out
- Output geotransform (allocated array of six doubles - updated).- Returns:
- 1 on success or 0 if the equation is uninvertable.
- Since:
- Java bindings 1.7.0
-
VersionInfo
public static java.lang.String VersionInfo(java.lang.String request)
Get runtime version information.Available request values:
- "VERSION_NUM": Returns GDAL_VERSION_NUM formatted as a string. i.e. "1170" Note: starting with GDAL 1.10, this string will be longer than 4 characters.
- "RELEASE_DATE": Returns GDAL_RELEASE_DATE formatted as a string. i.e. "20020416".
- "RELEASE_NAME": Returns the GDAL_RELEASE_NAME. i.e. "1.1.7"
- "--version": Returns one line version message suitable for use in response to --version requests. i.e. "GDAL 1.1.7, released 2002/04/16"
- "LICENCE": Returns the content of the LICENSE.TXT file from the GDAL_DATA directory.
- Parameters:
request
- the type of version info desired, as listed above.- Returns:
- a string containing the requested information.
-
VersionInfo
public static java.lang.String VersionInfo()
Get runtime version information.- Returns:
- a string containing GDAL_VERSION_NUM formatted as a string. i.e. "1170"
- Since:
- Java bindings 1.7.0
-
AllRegister
public static void AllRegister()
Register all known configured GDAL drivers.This function will drive any of the following that are configured into GDAL. Many others as well that haven't been updated in this documentation (see full list):
- GeoTIFF (GTiff)
- Geosoft GXF (GXF)
- Erdas Imagine (HFA)
- CEOS (CEOS)
- ELAS (ELAS)
- Arc/Info Binary Grid (AIGrid)
- SDTS Raster DEM (SDTS)
- OGDI (OGDI)
- ESRI Labelled BIL (EHdr)
- PCI .aux Labelled Raw Raster (PAux)
- HDF4 Hierachal Data Format Release 4
- HDF5 Hierachal Data Format Release 5
- GSAG Golden Software ASCII Grid
- GSBG Golden Software Binary Grid
This function should generally be called once at the beginning of the application.
-
GDALDestroyDriverManager
public static void GDALDestroyDriverManager()
-
GetCacheMax
public static int GetCacheMax()
Get maximum cache memory.Gets the maximum amount of memory available to the GDALRasterBlock caching system for caching GDAL read/write imagery.
- Returns:
- maximum in bytes.
-
GetCacheUsed
public static int GetCacheUsed()
Get cache memory used.- Returns:
- the number of bytes of memory currently in use by the GDALRasterBlock memory caching.
-
SetCacheMax
public static void SetCacheMax(int newSize)
Set maximum cache memory.This function sets the maximum amount of memory that GDAL is permitted to use for GDALRasterBlock caching.
- Parameters:
newSize
- the maximum number of bytes for caching. Maximum is 2GB.
-
GetDataTypeSize
public static int GetDataTypeSize(int eDataType)
Get data type size in bits.Returns the size of a GDT_* type in bits, not bytes!
- Parameters:
eDataType
- type, such as gdalconst.GDT_Byte.- Returns:
- the number of bits or zero if it is not recognised.
-
DataTypeIsComplex
public static int DataTypeIsComplex(int eDataType)
Is data type complex?- Returns:
- 1 if the passed type is complex (one of gdalconst.GDT_CInt16, GDT_CInt32, GDT_CFloat32 or GDT_CFloat64), that is it consists of a real and imaginary component.
-
GetDataTypeName
public static java.lang.String GetDataTypeName(int eDataType)
Get name of data type.Returns a symbolic name for the data type. This is essentially the the enumerated item name with the GDT_ prefix removed. So gdalconst.GDT_Byte returns "Byte". These strings are useful for reporting datatypes in debug statements, errors and other user output.
- Parameters:
eDataType
- type to get name of.- Returns:
- string corresponding to type.
-
GetDataTypeByName
public static int GetDataTypeByName(java.lang.String dataTypeName)
Get data type by symbolic name.Returns a data type corresponding to the given symbolic name. This function is opposite to the gdal.GetDataTypeName().
- Parameters:
dataTypeName
- string containing the symbolic name of the type.- Returns:
- GDAL data type.
-
DataTypeUnion
public static int DataTypeUnion(int a, int b)
-
GetColorInterpretationName
public static java.lang.String GetColorInterpretationName(int eColorInterp)
Get name of color interpretation.Returns a symbolic name for the color interpretation. This is derived from the enumerated item name with the GCI_ prefix removed, but there are some variations. So GCI_GrayIndex returns "Gray" and GCI_RedBand returns "Red". The returned strings are static strings and should not be modified or freed by the application.
- Parameters:
eColorInterp
- color interpretation to get name of.- Returns:
- string corresponding to color interpretation.
-
GetColorInterpretationByName
public static int GetColorInterpretationByName(java.lang.String pszColorInterpName)
-
GetPaletteInterpretationName
public static java.lang.String GetPaletteInterpretationName(int ePaletteInterp)
Get name of palette interpretation.Returns a symbolic name for the palette interpretation. This is the the enumerated item name with the GPI_ prefix removed. So GPI_Gray returns "Gray". The returned strings are static strings and should not be modified or freed by the application.
- Parameters:
ePaletteInterp
- palette interpretation to get name of.- Returns:
- string corresponding to palette interpretation.
-
DecToDMS
public static java.lang.String DecToDMS(double dfAngle, java.lang.String pszAxis, int nPrecision)
-
DecToDMS
public static java.lang.String DecToDMS(double dfAngle, java.lang.String pszAxis)
-
PackedDMSToDec
public static double PackedDMSToDec(double dfPacked)
-
DecToPackedDMS
public static double DecToPackedDMS(double dfDec)
-
ParseXMLString
public static XMLNode ParseXMLString(java.lang.String xmlString)
Parse an XML string into tree form.The passed document is parsed into a XMLNode tree representation. If the document is not well formed XML then null is returned, and errors are reported via CPLError(). No validation beyond wellformedness is done.
If the document has more than one "root level" element then those after the first will be attached to the first as siblings (via the psNext pointers) even though there is no common parent. A document with no XML structure (no angle brackets for instance) would be considered well formed, and returned as a single CXT_Text node.
- Parameters:
xmlString
- the document to parse.- Returns:
- parsed tree or null on error.
- Since:
- Java bindings 1.7.0
-
SerializeXMLTree
public static java.lang.String SerializeXMLTree(XMLNode xmlnode)
Convert tree into string document.This function converts a XMLNode tree representation of a document into a flat string representation. White space indentation is used visually preserve the tree structure of the document.
- Parameters:
xmlnode
- the root of the tree to serialize- Returns:
- the document on success or null on failure.
- Since:
- Java bindings 1.7.0
-
GetJPEG2000StructureAsString
public static java.lang.String GetJPEG2000StructureAsString(java.lang.String pszFilename, java.util.Vector options)
-
GetJPEG2000StructureAsString
public static java.lang.String GetJPEG2000StructureAsString(java.lang.String pszFilename)
-
HasTriangulation
public static int HasTriangulation()
-
GetDriverCount
public static int GetDriverCount()
Fetch the number of registered drivers.- Returns:
- the number of registered drivers.
-
GetDriverByName
public static Driver GetDriverByName(java.lang.String name)
Fetch a driver based on the short name.- Parameters:
name
- the short name, such as "GTiff", being searched for.- Returns:
- the identified driver, or null if no match is found.
-
GetDriver
public static Driver GetDriver(int iDriver)
Fetch driver by index.- Parameters:
iDriver
- the driver index from 0 to gdal.GetDriverCount()-1.- Returns:
- the driver identified by the index or null if the index is invalid
-
Open
public static Dataset Open(java.lang.String name, int eAccess)
Open a raster file as a Dataset object.This function will try to open the passed file, or virtual dataset name by invoking the Open method of each registered Driver in turn. The first successful open will result in a returned dataset. If all drivers fail then null is returned.
It is required that you explicitly close a dataset opened in update mode with the Dataset.delete() method. Otherwise the data might not be flushed to the disk. Don't rely only on Java garbage collection.
- Parameters:
name
- the name of the file to access. In the case of exotic drivers this may not refer to a physical file, but instead contain information for the driver on how to access a dataset.eAccess
- the desired access, either gdalconst.GA_Update or gdalconst.GA_ReadOnly. Many drivers support only read only access.- Returns:
- A Dataset object or null on failure.
- See Also:
OpenShared(String name, int eAccess)
-
Open
public static Dataset Open(java.lang.String name)
Open a raster file as a Dataset object.Same as below with eAccess == gdalconst.GA_ReadOnly
- Since:
- Java bindings 1.7.0
- See Also:
Open(String name, int eAccess)
-
OpenEx
public static Dataset OpenEx(java.lang.String utf8_path, long nOpenFlags, java.util.Vector allowed_drivers, java.util.Vector open_options, java.util.Vector sibling_files)
-
OpenEx
public static Dataset OpenEx(java.lang.String utf8_path, long nOpenFlags, java.util.Vector allowed_drivers, java.util.Vector open_options)
-
OpenEx
public static Dataset OpenEx(java.lang.String utf8_path, long nOpenFlags, java.util.Vector allowed_drivers)
-
OpenEx
public static Dataset OpenEx(java.lang.String utf8_path, long nOpenFlags)
-
OpenEx
public static Dataset OpenEx(java.lang.String utf8_path)
-
OpenShared
public static Dataset OpenShared(java.lang.String name, int eAccess)
Open a raster file as a GDALDataset.This function works the same as gdal.Open(), but allows the sharing of GDALDataset handles for a dataset with other callers to gdal.OpenShared().
In particular, gdal.OpenShared() will first consult it's list of currently open and shared Dataset's, and if the GetDescription() name for one exactly matches the name passed to gdal.OpenShared() it will be referenced and returned.
- Parameters:
name
- the name of the file to access. In the case of exotic drivers this may not refer to a physical file, but instead contain information for the driver on how to access a dataset.eAccess
- the desired access, either gdalconst.GA_Update or gdalconst.GA_ReadOnly. Many drivers support only read only access.- Returns:
- A Dataset object or null on failure.
- See Also:
Open(String name, int eAccess)
-
OpenShared
public static Dataset OpenShared(java.lang.String name)
Open a raster file as a Dataset object.Same as below with eAccess == gdalconst.GA_ReadOnly
- Since:
- Java bindings 1.7.0
- See Also:
OpenShared(String name, int eAccess)
-
IdentifyDriver
public static Driver IdentifyDriver(java.lang.String name, java.util.Vector fileList)
Identify the driver that can open a raster file.This function will try to identify the driver that can open the passed file name by invoking the Identify method of each registered Driver in turn. The first driver that successful identifies the file name will be returned. If all drivers fail then null is returned.
In order to reduce the need for such searches touch the operating system file system machinery, it is possible to give an optional list of files. This is the list of all files at the same level in the file system as the target file, including the target file. The filenames will not include any path components, are an essentially just the output of ReadDir() on the parent directory. If the target object does not have filesystem semantics then the file list should be null.
- Parameters:
name
- the name of the file to access. In the case of exotic drivers this may not refer to a physical file, but instead contain information for the driver on how to access a dataset.fileList
- a vector of strings. These strings are filenames that are auxiliary to the main filename. The passed value may be null.- Returns:
- A Driver object or null on failure.
-
IdentifyDriver
public static Driver IdentifyDriver(java.lang.String name)
Identify the driver that can open a raster file.Same as below with fileList == null
- Since:
- Java bindings 1.7.0
- See Also:
IdentifyDriver(String name, java.util.Vector fileList)
-
IdentifyDriverEx
public static Driver IdentifyDriverEx(java.lang.String utf8_path, long nIdentifyFlags, java.util.Vector allowed_drivers, java.util.Vector sibling_files)
-
IdentifyDriverEx
public static Driver IdentifyDriverEx(java.lang.String utf8_path, long nIdentifyFlags, java.util.Vector allowed_drivers)
-
IdentifyDriverEx
public static Driver IdentifyDriverEx(java.lang.String utf8_path, long nIdentifyFlags)
-
IdentifyDriverEx
public static Driver IdentifyDriverEx(java.lang.String utf8_path)
-
GeneralCmdLineProcessor
public static java.util.Vector GeneralCmdLineProcessor(java.util.Vector args, int options)
General utility option processing. Same as below but with arguments as a Vector of strings- Returns:
- updated argument list as a new Vector of strings
- See Also:
GeneralCmdLineProcessor(String[] args, int options)
-
GeneralCmdLineProcessor
public static java.util.Vector GeneralCmdLineProcessor(java.util.Vector args)
General utility option processing. Same as below but with arguments as a Vector of strings and options == 0- Returns:
- updated argument list as a new Vector of strings
- Since:
- Java bindings 1.7.0
- See Also:
GeneralCmdLineProcessor(String[] args, int options)
-
GDALInfo
public static java.lang.String GDALInfo(Dataset hDataset, InfoOptions infoOptions)
-
GDALVectorInfo
public static java.lang.String GDALVectorInfo(Dataset hDataset, VectorInfoOptions infoOptions)
-
GDALMultiDimInfo
public static java.lang.String GDALMultiDimInfo(Dataset hDataset, MultiDimInfoOptions infoOptions)
-
Translate
public static Dataset Translate(java.lang.String dest, Dataset dataset, TranslateOptions translateOptions, ProgressCallback callback)
-
Translate
public static Dataset Translate(java.lang.String dest, Dataset dataset, TranslateOptions translateOptions)
-
Warp
public static int Warp(Dataset dstDS, Dataset[] object_list_count, WarpOptions warpAppOptions, ProgressCallback callback)
-
Warp
public static int Warp(Dataset dstDS, Dataset[] object_list_count, WarpOptions warpAppOptions)
-
Warp
public static Dataset Warp(java.lang.String dest, Dataset[] object_list_count, WarpOptions warpAppOptions, ProgressCallback callback)
-
Warp
public static Dataset Warp(java.lang.String dest, Dataset[] object_list_count, WarpOptions warpAppOptions)
-
VectorTranslate
public static int VectorTranslate(Dataset dstDS, Dataset srcDS, VectorTranslateOptions options, ProgressCallback callback)
-
VectorTranslate
public static int VectorTranslate(Dataset dstDS, Dataset srcDS, VectorTranslateOptions options)
-
VectorTranslate
public static Dataset VectorTranslate(java.lang.String dest, Dataset srcDS, VectorTranslateOptions options, ProgressCallback callback)
-
VectorTranslate
public static Dataset VectorTranslate(java.lang.String dest, Dataset srcDS, VectorTranslateOptions options)
-
DEMProcessing
public static Dataset DEMProcessing(java.lang.String dest, Dataset dataset, java.lang.String pszProcessing, java.lang.String pszColorFilename, DEMProcessingOptions options, ProgressCallback callback)
-
DEMProcessing
public static Dataset DEMProcessing(java.lang.String dest, Dataset dataset, java.lang.String pszProcessing, java.lang.String pszColorFilename, DEMProcessingOptions options)
-
Nearblack
public static int Nearblack(Dataset dstDS, Dataset srcDS, NearblackOptions options, ProgressCallback callback)
-
Nearblack
public static int Nearblack(Dataset dstDS, Dataset srcDS, NearblackOptions options)
-
Nearblack
public static Dataset Nearblack(java.lang.String dest, Dataset srcDS, NearblackOptions options, ProgressCallback callback)
-
Nearblack
public static Dataset Nearblack(java.lang.String dest, Dataset srcDS, NearblackOptions options)
-
Grid
public static Dataset Grid(java.lang.String dest, Dataset dataset, GridOptions options, ProgressCallback callback)
-
Grid
public static Dataset Grid(java.lang.String dest, Dataset dataset, GridOptions options)
-
Rasterize
public static int Rasterize(Dataset dstDS, Dataset srcDS, RasterizeOptions options, ProgressCallback callback)
-
Rasterize
public static int Rasterize(Dataset dstDS, Dataset srcDS, RasterizeOptions options)
-
Rasterize
public static Dataset Rasterize(java.lang.String dest, Dataset srcDS, RasterizeOptions options, ProgressCallback callback)
-
Rasterize
public static Dataset Rasterize(java.lang.String dest, Dataset srcDS, RasterizeOptions options)
-
Footprint
public static int Footprint(Dataset dstDS, Dataset srcDS, FootprintOptions options, ProgressCallback callback)
-
Footprint
public static int Footprint(Dataset dstDS, Dataset srcDS, FootprintOptions options)
-
Footprint
public static Dataset Footprint(java.lang.String dest, Dataset srcDS, FootprintOptions options, ProgressCallback callback)
-
Footprint
public static Dataset Footprint(java.lang.String dest, Dataset srcDS, FootprintOptions options)
-
BuildVRT
public static Dataset BuildVRT(java.lang.String dest, Dataset[] object_list_count, BuildVRTOptions options, ProgressCallback callback)
-
BuildVRT
public static Dataset BuildVRT(java.lang.String dest, Dataset[] object_list_count, BuildVRTOptions options)
-
BuildVRT
public static Dataset BuildVRT(java.lang.String dest, java.util.Vector source_filenames, BuildVRTOptions options, ProgressCallback callback)
-
BuildVRT
public static Dataset BuildVRT(java.lang.String dest, java.util.Vector source_filenames, BuildVRTOptions options)
-
TileIndex
public static Dataset TileIndex(java.lang.String dest, java.util.Vector source_filenames, TileIndexOptions options, ProgressCallback callback)
-
TileIndex
public static Dataset TileIndex(java.lang.String dest, java.util.Vector source_filenames, TileIndexOptions options)
-
MultiDimTranslate
public static Dataset MultiDimTranslate(java.lang.String dest, Dataset[] object_list_count, MultiDimTranslateOptions multiDimTranslateOptions, ProgressCallback callback)
-
MultiDimTranslate
public static Dataset MultiDimTranslate(java.lang.String dest, Dataset[] object_list_count, MultiDimTranslateOptions multiDimTranslateOptions)
-
-