|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGDALUtilities
public final class GDALUtilities
Utility class providing a set of static utility methods
Nested Class Summary | |
---|---|
static class |
GDALUtilities.DriverCreateCapabilities
Simple placeholder for information about a driver's capabilities. |
static class |
GDALUtilities.GDALMetadataDomain
Simple placeholder for Strings representing GDAL metadata domains. |
static class |
GDALUtilities.MetadataChoice
An auxiliary simple class containing only contants which are used to handle text building and visualization |
Field Summary | |
---|---|
static Dimension |
DEFAULT_TILE_SIZE
The default tile size. |
static String |
GDALMEMORYRASTER_MAXSIZE_KEY
System property name to customize the max supported size of a GDAL In Memory Raster Dataset to be created before using the createCopy method |
static int |
MIN_TILE_SIZE
The minimums tile size. |
static String |
newLine
|
static String |
STANDARD_METADATA_NAME
|
Method Summary | |
---|---|
static Dataset |
acquireDataSet(String name,
int accessType)
Acquires a Dataset and return it, given the name of the Dataset
source and the desired access type |
static ColorModel |
buildColorModel(SampleModel sampleModel)
Builds a proper ColorModel for a specified
SampleModel |
static String |
buildCRSProperties(RenderedImage ri,
int index)
|
static String |
buildMetadataText(RenderedImage ri,
GDALUtilities.MetadataChoice metadataFields,
int index)
|
static void |
closeDataSet(Dataset ds)
Closes the given Dataset . |
static GDALUtilities.DriverCreateCapabilities |
formatWritingCapabilities(String driverName)
Tells us about the capabilities for a GDAL driver. |
static int |
getCacheMax()
Returns the maximum amount of memory available for GDAL caching mechanism. |
static int |
getCacheUsed()
Returns the amount of GDAL cache used. |
static List<String> |
getGDALImageMetadata(String dataSetName)
Returns any metadata related to the specified image. |
static List |
getGDALStreamMetadata(String datasetName)
Returns any metadata which is not related to a specific image. |
static String |
getImageMetadata(GDALImageReader reader,
int index)
|
static List |
getJDKImageReaderWriterSPI(ServiceRegistry registry,
String formatName,
boolean isReader)
|
static String |
getMetadataItem(List imageMetadata,
String metadataName)
Returns the value of a specific metadata item contained in the metadata given as first input parameter |
static String |
getStreamMetadata(GDALImageReader reader)
|
static String |
getStreamMetadataItem(String metadataName,
String datasetName)
Returns the value of a specific metadata item related to the stream. |
static boolean |
isDriverAvailable(String driverName)
Returns true if a driver for the specific format is
available. |
static boolean |
isGDALAvailable()
Returns true if the GDAL native library has been loaded. |
static void |
loadGDAL()
Forces loading of GDAL libs. |
static int |
retrieveGDALDataBufferType(int dataBufferType)
Simply provides to retrieve the corresponding GDALDataType
for the specified dataBufferType |
static void |
setCacheMax(int maxCacheSize)
Sets the GDAL Max Cache Size. |
static void |
setGdalCaching(boolean useCaching)
Allows to enable/disable GDAL caching mechanism. |
static void |
setGdalPAM(boolean usePAM)
Allows to enable/disable GDAL Persistable Auxiliary Metadata. |
static void |
setNodeAttribute(String name,
Object val,
IIOMetadataNode node,
int attributeType)
Set the value of a specific attribute of a specific IIOMetadataNode |
static Dimension |
toTileSize(Dimension size)
Suggests a tile size for the specified image size. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String STANDARD_METADATA_NAME
public static final String newLine
public static final String GDALMEMORYRASTER_MAXSIZE_KEY
public static final Dimension DEFAULT_TILE_SIZE
JAI.setDefaultTileSize(java.awt.Dimension)
.
public static final int MIN_TILE_SIZE
Method Detail |
---|
public static int retrieveGDALDataBufferType(int dataBufferType)
GDALDataType
for the specified dataBufferType
dataBufferType
- the DataBuffer
type for which we need to
retrieve the proper GDALDataType
GDALDataType
public static int getCacheMax()
public static int getCacheUsed()
public static List getJDKImageReaderWriterSPI(ServiceRegistry registry, String formatName, boolean isReader)
public static void setCacheMax(int maxCacheSize)
maxCacheSize
- public static void setGdalCaching(boolean useCaching)
useCaching
- true
to enable GDAL caching.
false
to disable GDAL caching.public static void setGdalPAM(boolean usePAM)
usePAM
- true
to enable GDAL PAM. false
to disable GDAL PAM.public static Dataset acquireDataSet(String name, int accessType)
Dataset
and return it, given the name of the Dataset
source and the desired access type
name
- of the dataset source to be accessed (usually, a File
name).accessType
-
Dataset
public static List<String> getGDALImageMetadata(String dataSetName)
dataSetName
- the name of the dataset for which we need to retrieve
imageMetadata
List
containing any metadata found.public static void closeDataSet(Dataset ds)
Dataset
.
ds
- Dataset
to close.public static boolean isDriverAvailable(String driverName)
true
if a driver for the specific format is
available. false
otherwise.
true
if a driver for the specific format is
available. false
otherwise.public static GDALUtilities.DriverCreateCapabilities formatWritingCapabilities(String driverName)
driverName
- name of the Driver
we want to get info about.
GDALUtilities.DriverCreateCapabilities.CREATE
in case the
driver supports creation of dataset,
GDALUtilities.DriverCreateCapabilities.CREATE_COPY
in
case the driver supports only create copy and eventually
GDALUtilities.DriverCreateCapabilities.READ_ONLY
for
read-only drivers.
IllegalArgumentException
- in case the specified driver name is null
or a Driver for the specified name is unavailable.public static String getStreamMetadataItem(String metadataName, String datasetName)
metadataName
- the name of the specified metadata item.datasetName
-
public static String getMetadataItem(List imageMetadata, String metadataName)
gdalImageMetadata
- the required metadata List
(gdalStreamMetadata or gdalImageMetadata)metadataName
- the name of the specified metadata item
public static List getGDALStreamMetadata(String datasetName)
datasetName
-
List
containing metadata related to the stream.public static void setNodeAttribute(String name, Object val, IIOMetadataNode node, int attributeType)
IIOMetadataNode
name
- The name of the attribute which need to be setval
- The value we want to setnode
- The IIOMetadataNode
having the attribute we
are going to setattributeType
- The type of the attribute we are going to setpublic static Dimension toTileSize(Dimension size)
size
is the image's size. On output, it is the tile size. This method write
the result directly in the supplied object and returns size
for
convenience.
public static boolean isGDALAvailable()
true
if the GDAL native library has been loaded.
false
otherwise.
true
only if the GDAL native library has been
loaded.public static void loadGDAL()
public static ColorModel buildColorModel(SampleModel sampleModel)
ColorModel
for a specified
SampleModel
sampleModel
- the sampleModel to be used as reference.
ColorModel
for the input
SampleModel
public static String buildCRSProperties(RenderedImage ri, int index)
public static String buildMetadataText(RenderedImage ri, GDALUtilities.MetadataChoice metadataFields, int index)
public static String getImageMetadata(GDALImageReader reader, int index)
public static String getStreamMetadata(GDALImageReader reader) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |