public class JGeoRasterMeta
extends java.lang.Object
JGeoRasterMeta (georasterMetadata) | ---------------------------------------------------------------------------------------------- | | | | | | ObjectInfo RasterInfo SpatialReferenceInfo TemporalReferenceInfo bandReferenceInfo LayerInfo (objectInfo) (rasterInfo)(spatialReferenceInfo) (temporalReferenceInfo) (bandReferenceInfo) (layerInfo) | -------------- | | SubLayerInfo Vector of SubLayerInfo (objectLayer) (subLayer)In these Java classes, all necessary methods are created to allow you to get/set value of each attribute defined in the specific mapped XML element, and through hierarchical structure above, you can easily manipulate all metadata, for example, the following sample code is used to get NODATA value defined in the objectLayer
... //reading a GeoRaster object from database based on a query ResultSet rs = statement.executeQuery("SELECT a.georaster FROM georaster_table a where a.georaster.rasterdatatable='RDT' and a.georaster.rasterid=1"); STRUCT geor = (oracle.sql.STRUCT) rs.getObject(1); //construct a JGeoRaster object JGeoRaster geoRaster = new JGeoRaster(geor); //get GeoRasterImage instance JGeoRasterMeta geoRasterMeta=geoRaster.getMetadataObject(); //get NODATA value defined in the objectLayer Vector nodata=geoRasterMeta.getLayerInfo().getObjectLayer().getNODATAValue(); ...JGeoRasterMeta is a Java class mapped to the XML element georasterMetadata in the Oracle Spatial GeoRaster metadata, and it is the root access point of the whole hierarchical structure above.
A JGeoRasterMeta object is always associated with a JGeoRaster object; it cannot be constructed directly. When a JGeoRaster is initiated, the metadata XML string will be retrieved from the database server and populated into the JGeoRasterMeta object and other related Java objects. After the JGeoRaster is initiated successfully, the following method defined in the JGeoRaster is used to retrieve an instance of JGeoRasterMeta:
public JGeoRasterMeta getMetadataObject()
Inside the JGeoRasterMeta class, all get***Info() methods are used to get instances of second level XML elements, but there is possibility that the return value is null, because some second level elements are optional in the XML schema, such as bandReferenceInfo. In this case, if you want to add a missing second level element into metadata, all init***Info() methods are designed to construct and add an empty second level element based on default value defined in the XML schema.
In order to avoid mistaken modification on some critical metadata attributes, which might result in raster data corruption, the following attributes are not allowed to be changed in each second level XML element directly:
DimensionSize CellDepth Interleaving Blocking BlockSize PyramidLevel PyramidResampling CompressionHowever, a method init() is defined in the JGeoRasterMeta class, and provides a way to initiate these critical metadata. The init() method actually is a mapping of the server side PL/SQL function createTemplate(), which takes the rasterSpec string to initialize basic metadata.
Modifier and Type | Method and Description |
---|---|
java.lang.Object[][] |
display()
Returns a two-dimensional array to list all metadata information.
|
BandReferenceInfo |
getBandReferenceInfo()
Returns an BandReferenceInfo object, which represents the XML BandReferenceInfo element, contained in the current instance.
|
LayerInfo |
getLayerInfo()
Returns an LayerInfo object, which represents the XML LayerInfo element, contained in the current instance.
|
ObjectInfo |
getObjectInfo()
Returns an ObjectInfo object, which represents the XML objectInfo element, contained in the current instance.
|
RasterInfo |
getRasterInfo()
Returns an RasterInfo object, which represents the XML RasterInfo element, contained in the current instance.
|
java.lang.String[] |
getSourceInfo()
Returns an array of string, which represents the XML SourceInfo nodes, contained in the current instance.
|
SpatialReferenceInfo |
getSpatialReferenceInfo()
Returns an SpatialReferenceInfo object, which represents the XML SpatialReferenceInfo element, contained in the current instance.
|
TemporalReferenceInfo |
getTemporalReferenceInfo()
Returns an TemporalReferenceInfo object, which represents the XML TemporalReferenceInfo element, contained in the current instance.
|
java.lang.String |
getXMLString()
Returns an XML string represented by this GeoRasterMetadata object.
|
boolean |
hasBitmapMask(int layerNo)
Returns
true if the GeoRaster object has a bitmapMask defined in the layer layerNo |
void |
init(int rasterType, java.lang.String rasterSpec)
Initiates a JGeoRasterMeta object based on a general pattern of metadata of a JGeoRaster object.
|
BandReferenceInfo |
initBandReferenceInfo()
If the current instance does not contain a BandReferenceInfo instance, then an empty BandReferenceInfo is created and added to the current instance, otherwise just return current BandReferenceInfo.
|
LayerInfo |
initLayerInfo()
If the current instance does not contain a LayerInfo instance, then an empty LayerInfo is created and added to the current instance, otherwise just return current LayerInfo.
|
ObjectInfo |
initObjectInfo()
If the current instance does not contain an ObjectInfo instance, then an empty ObjectInfo is created and added to the current instance; otherwise, just return the current ObjectInfo.
|
RasterInfo |
initRasterInfo()
If the current instance does not contain a RasterInfo instance, then an empty RasterInfo is created and added to the current instance; otherwise, just return the current RasterInfo.
|
SpatialReferenceInfo |
initSpatialReferenceInfo()
If the current instance does not contain a SpatialReferenceInfo instance, then an empty SpatialReferenceInfo is created and added to the current instance, otherwise just return current SpatialReferenceInfo.
|
TemporalReferenceInfo |
initTemporalReferenceInfo()
If the current instance does not contain a TemporalReferenceInfo instance, then an empty TemporalReferenceInfo is created and added to the current instance, otherwise just return current TemporalReferenceInfo.
|
void |
setSourceInfo(java.lang.String[] sourceInfo)
set sourceInfo by a given array of string
|
oracle.sql.STRUCT |
storeToDB()
Deprecated.
|
java.sql.Struct |
storeToDBJS()
Updates server-side metadata by the XML string generated from this class.
|
boolean |
validate()
Validates GeoRaster metadata represented by current instance
|
public ObjectInfo getObjectInfo()
null
.ObjectInfo
, initObjectInfo()
public ObjectInfo initObjectInfo()
ObjectInfo
, getObjectInfo()
public RasterInfo getRasterInfo()
null
.RasterInfo
, initRasterInfo()
public RasterInfo initRasterInfo()
RasterInfo
, getRasterInfo()
public SpatialReferenceInfo getSpatialReferenceInfo()
null
.SpatialReferenceInfo
, initSpatialReferenceInfo()
public SpatialReferenceInfo initSpatialReferenceInfo()
SpatialReferenceInfo
, getSpatialReferenceInfo()
public TemporalReferenceInfo getTemporalReferenceInfo()
null
.TemporalReferenceInfo
, initTemporalReferenceInfo()
public TemporalReferenceInfo initTemporalReferenceInfo()
TemporalReferenceInfo
, getTemporalReferenceInfo()
public BandReferenceInfo getBandReferenceInfo()
null
.BandReferenceInfo
, initBandReferenceInfo()
public BandReferenceInfo initBandReferenceInfo()
BandReferenceInfo
, getBandReferenceInfo()
public LayerInfo getLayerInfo()
null
.LayerInfo
, initLayerInfo()
public LayerInfo initLayerInfo()
LayerInfo
, getLayerInfo()
public java.lang.String[] getSourceInfo()
null
.setSourceInfo(java.lang.String[])
public void setSourceInfo(java.lang.String[] sourceInfo)
sourceInfo
- a array of string, which represents sourceInfo.getSourceInfo()
public boolean hasBitmapMask(int layerNo)
true
if the GeoRaster object has a bitmapMask defined in the layer layerNo
layerNo
- a string, which represents layer number.false
.public boolean validate() throws java.lang.Exception
java.lang.Exception
public java.lang.String getXMLString() throws GeoRasterException
GeoRasterException
public void init(int rasterType, java.lang.String rasterSpec) throws GeoRasterException
rasterType
- a 5-digit rasterType attribute valuerasterSpec
- a string with raster specification parameters. The rasterSpec parameter must be a string that contains one or more of the following keyword-value pairs:
dimSize (for example, dimSize=(256,256,3)): Specifies the row, column, and band dimension sizes. This keyword must be specified and must be consistent with the rasterType parameter.
ultCoord (for example, ultCoord=(0,0,0)): Specifies the upper-left coordinate integer values for the GeoRaster object. The default value is 0 for all the dimensions. The value for the band dimension must be 0.
cellDepth (for example, cellDepth=8BIT_S): Specifies the cell depth of the GeoRaster object. Must be one of the following values (with _U indicating unsigned and _S indicating signed): 1BIT, 2BIT, 4BIT, 8BIT_U, 8BIT_S, 16BIT_U, 16BIT_S, 32BIT_U, 32BIT_S, 32BIT_REAL, or 64BIT_REAL. The default value is 8BIT_U.
interleaving (for example, interleaving=BIP): Specifies the interleaving type. Must be one of the following values: BSQ, BIL, or BIP. The default value is BSQ.
blocking (for example, blocking=TRUE): Specified whether the GeoRaster object is blocked. Must be either TRUE or FALSE. The default value is FALSE if blocksize is not specified.
blocksize (for example, blocksize=(128,128,3)): Specifies the block size for each dimension of the GeoRaster object. The values must be non-negative integers. A zero block size value means the corresponding dimension size is the real value. Is blocking is set to TRUE but blocksize is not specified, the GeoRaster object's blocksize is (256,256,B), where B is the band dimension size.
rLevel (for example, rLevel=2): Specifies the maximum pyramid reduction level. Must be a positive integer. If you specify this keyword, the pyramid type is set to DECREASE in the metadata; otherwise the pyramid type is set to NONE.
resampling (for example, resampling=NN): Specifies the resampling method. Must be one of the following: NN (value of the nearest neighbor cell in the original GeoRaster object), BILINEAR (distance-weighted average of the 4 nearest cells in the original GeoRaster object), AVERAGE4 (simple average of the 4 nearest cells in the original GeoRaster object), AVERAGE16 (simple average of the 16 nearest cells in the original GeoRaster object), CUBIC (cubic convolution of the 16 nearest cells in the original GeoRaster object). This keyword is ignored if rLevel is not set.
compression (for example, compression=JPEG-F): Specifies the compression type of the GeoRaster object. Must be one of the following: NONE, DEFLATE or JPEG-F. The default value is NONE.
quality (for example, quality=75): Specifies the JPEG compression quality, which is the degree of lossiness caused by the compression. Must be an integer from 0 (lowest quality) through 100 (highest quality). This keyword is ignored when the compression keyword is not specified or is not set to one of the JPEG types.
GeoRasterException
@Deprecated public oracle.sql.STRUCT storeToDB() throws java.lang.Exception
java.lang.Exception
public java.sql.Struct storeToDBJS() throws java.lang.Exception
java.lang.Exception
public java.lang.Object[][] display()