public class SdoGeorUtlPKG
extends java.lang.Object
Note that all methods in this class are transactional, which means that no commit statement is issued implicitly in each method.
The following is an example of how to use this class:
//initialize an instance of SdoGeorUtlPKG SdoGeorUtlPKG pkg=new SdoGeorUtlPKG(connection); //reading a GeoRaster object from database based on a query Statement stmt = connection.createStatement(); ResultSet rs = statement.executeQuery("SELECT a.georaster FROM georaster_table a where a.georaster.rasterdatatable='RDT' and a.georaster.rasterid=1"); rs.next(); STRUCT geor = (oracle.sql.STRUCT) rs.getObject(1); //convert STRUCT into SdoGeoRaster SdoGeoRaster sdoGeoRaster = new SdoGeoRaster(geor); //calcRasterStorageSize size=pkg.calcRasterStorageSize(sdoGeoRaster);
Constructor and Description |
---|
SdoGeorUtlPKG(java.sql.Connection conn)
Constructs an
SdoGeorUtlPKG object using the given connection. |
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal[] |
calcOptimizedBlockSize(long[] dimensionSize, long[] blockSize, long pyramidLevel)
Calculates an optimal blockSize value that will use less padding space in the GeoRaster object storage, based on the GeoRaster dimension sizes and the user-specified block size values.
|
double |
calcRasterNominalSize(SdoGeoRaster georaster, boolean padding, boolean pyramid, boolean bitmapMask)
Returns the total raster block length (in bytes) of a GeoRaster object, as if it were not compressed and did not contain any empty raster blocks.
|
double |
calcRasterStorageSize(SdoGeoRaster georaster)
Returns the actual length (in bytes) of all raster blocks of a GeoRaster object.
|
double |
calcSurfaceArea(SdoGeoRaster geoRaster, JGeometry window, int parallel)
Calculates the three dimensional (3D) surface area represented by digital elevation model (DEM) data that is stored in a GeoRaster object.
|
void |
clearReportTable(java.lang.Long client_id)
Deletes records in the table that contains GeoRaster operation status information.
|
void |
createDMLTrigger(java.lang.String tableName, java.lang.String columnName)
Creates the required standard GeoRaster data manipulation language (DML) trigger on a GeoRaster column in a GeoRaster table, so that the appropriate operations are performed when its associated trigger is fired.
|
void |
createReportTable()
Creates the table to contain GeoRaster operation status information.
|
void |
disableReport()
Disables status reporting on GeoRaster operations in the current session.
|
void |
dropReportTable()
Drops the table that contains GeoRaster operation status information.
|
void |
emptyBlocks(SdoGeoRaster georaster, double[] bgValues)
Trims all blocks that contain only the specified background values to empty LOBs, thus making them empty blocks.
|
void |
enableReport()
Enables status reporting on GeoRaster operations in the current session.
|
void |
fillEmptyBlocks(SdoGeoRaster georaster, double[] bgValues)
Fills in all empty blocks with specified background values.
|
GeorColormap |
generateColorRamp(GeorColormap colorSeeds, java.math.BigDecimal[] rampSteps, java.lang.String cellValueType, java.lang.String interpoParam)
Generates an SDO_GEOR_COLORMAP object with a color ramp (gradient) by interpolating the red, green, blue, and alpha values entered as seed.
|
GeorGrayscale |
generateGrayRamp(GeorGrayscale grayScale, java.math.BigDecimal[] rampSteps, java.lang.String cellValueType, java.lang.String interpoParam)
Generates an SDO_GEOR_GRAYSCALE object with a grayscale ramp (gradient) by interpolating the values entered as seed.
|
java.lang.String |
getAllStatusReport()
Returns the current status for all operations for all clients in the status table.
|
java.sql.Connection |
getConnection()
Returns a connection which points to target database.
|
long |
getMaxMemSize()
Returns the upper limit size of the memory that can be used for managing memory using the GeoRaster buffer system.
|
double |
getProgress(long client_id, long seq_id)
Returns the progress of the operation for a specified client (session) and optionally for a specified operation.
|
long |
getReadBlockMemSize()
Returns the size in bytes of the GeoRaster internal data block for read-only operations.
|
java.lang.String |
getStatusReport(long client_id, long seq_id)
Returns the current status of the operations in the status table for a specified client (session) and optionally for a specified operation.
|
long |
getWriteBlockMemSize()
Returns the size in bytes of the GeoRaster internal data block for read/write operations.
|
int |
isReporting()
Checks if any session has status reporting enabled.
|
void |
makeRDTNamesUnique()
Renames some existing registered raster data tables that do not have unique names so that all raster data table names are unique within the database, and updates the GeoRaster system data and all affected GeoRaster objects to reflect the new names.
|
void |
recreateDMLTriggers()
Re-creates the required standard GeoRaster data manipulation language (DML) triggers on all GeoRaster columns that the current user has privileges to access, so that the appropriate operations are performed when the triggers are fired.
|
void |
renameRDT(java.lang.String oldRDT, java.lang.String newRDT)
Renames one or more existing registered raster data tables owned by the current user, and updates the GeoRaster system data and all affected GeoRaster objects to reflect the new names.
|
void |
setClientID(long client_id)
Sets the client ID for a session.
|
void |
setConnection(java.sql.Connection conn)
Sets the connection which points to the target database.
|
void |
setMaxMemSize(java.lang.Long maxMemSize)
Sets the upper limit size of the memory that can be used for managing memory using the GeoRaster buffer system.
|
void |
setReadBlockMemSize(java.lang.Long memBlockSize)
Sets the size of the GeoRaster internal data block for read-only operations.
|
void |
setSeqID(long seq_id)
Sets the sequence ID for a session.
|
void |
setWriteBlockMemSize(java.lang.Long memBlockSize)
Sets the size of the GeoRaster internal data block for read/write operations.
|
public SdoGeorUtlPKG(java.sql.Connection conn)
SdoGeorUtlPKG
object using the given connection.conn
- a JDBC connection.public void setConnection(java.sql.Connection conn)
conn
- a JDBC connectionpublic java.sql.Connection getConnection()
public java.math.BigDecimal[] calcOptimizedBlockSize(long[] dimensionSize, long[] blockSize, long pyramidLevel) throws java.lang.Exception
dimensionSize
- Dimension size array of the GeoRaster object.blockSize
- Block size array, which holds the user-specified block size valuespyramidLevel
- Maximum pyramid level.java.lang.Exception
public double calcRasterNominalSize(SdoGeoRaster georaster, boolean padding, boolean pyramid, boolean bitmapMask) throws java.lang.Exception
georaster
- georaster object.padding
- The TRUE causes padding in the raster blocks to be considered; the FALSE causes padding in the raster blocks not to be considered.pyramid
- The TRUE causes the size of any pyramids to be considered; the FALSE causes the size of any pyramids not to be considered.bitmapMask
- The TRUE (the default) causes any associated bitmap masks to be considered; the FALSE causes any associated bitmap masks not to be considered.java.lang.Exception
public double calcRasterStorageSize(SdoGeoRaster georaster) throws java.lang.Exception
georaster
- georaster object.java.lang.Exception
public void createDMLTrigger(java.lang.String tableName, java.lang.String columnName) throws java.lang.Exception
tableName
- Name of a GeoRaster table (the table containing rows with at least one GeoRaster object column).columnName
- Name of a column of type SDO_GEORASTER in the GeoRaster table.java.lang.Exception
public void fillEmptyBlocks(SdoGeoRaster georaster, double[] bgValues) throws java.lang.Exception
georaster
- georaster object.bgValues
- background values for filling partially empty raster blocks.java.lang.Exception
public void makeRDTNamesUnique() throws java.lang.Exception
java.lang.Exception
public void renameRDT(java.lang.String oldRDT, java.lang.String newRDT) throws java.lang.Exception
oldRDT
- Name of the registered raster data table or tables to be renamed. For multiple tables, use a comma-delimited list.newRDT
- New names to be assigned to the raster data table or tables that are specified in oldRDTs. For multiple tables, use a comma-delimited list with an order exactly reflecting the names in oldRDTs. If this parameter is null, GeoRaster assigns a unique new name to each input raster data table.java.lang.Exception
public void emptyBlocks(SdoGeoRaster georaster, double[] bgValues) throws java.lang.Exception
georaster
- georaster object.bgValues
- Background values for determining if a block can be made an empty raster block. The number of ARRAY object must be either one (same filling value used for all layers) or the layer dimension size (a different filling value for each layer, respectively).java.lang.Exception
public void recreateDMLTriggers() throws java.lang.Exception
java.lang.Exception
public void enableReport() throws java.lang.Exception
java.lang.Exception
public void clearReportTable(java.lang.Long client_id) throws java.lang.Exception
client_id
- ID of the client whose records are to be deleted. If this parameter is not specified, all records in the table are deleted.(The client ID can be set by using the SDO_GEOR_UTL.setClientID procedure.)java.lang.Exception
public void createReportTable() throws java.lang.Exception
java.lang.Exception
public void disableReport() throws java.lang.Exception
java.lang.Exception
public void dropReportTable() throws java.lang.Exception
java.lang.Exception
public java.lang.String getAllStatusReport() throws java.lang.Exception
java.lang.Exception
public double getProgress(long client_id, long seq_id) throws java.lang.Exception
client_id
- Unique numeric value identifying the session.seq_id
- Unique numeric value (within the specified session) identifying the operation for which to return status information.java.lang.Exception
public java.lang.String getStatusReport(long client_id, long seq_id) throws java.lang.Exception
client_id
- Unique numeric value identifying the session.seq_id
- Unique numeric value (within the specified session) identifying the operation for which to return status information.java.lang.Exception
public int isReporting() throws java.lang.Exception
java.lang.Exception
public void setClientID(long client_id) throws java.lang.Exception
client_id
- Unique ID value to identify the session.java.lang.Exception
public void setSeqID(long seq_id) throws java.lang.Exception
seq_id
- Unique ID value to identify the operation in a session.java.lang.Exception
public double calcSurfaceArea(SdoGeoRaster geoRaster, JGeometry window, int parallel) throws java.lang.Exception
georaster
- GeoRaster object in which DEM data is stored.window
- The 2D geometry object specifying the area of which the 3D surface area is to be calculated.parallel
- Degree of parallelism for the operation. It should be more than 0. The recommended value is 2 times the number of CPUsjava.lang.Exception
public GeorColormap generateColorRamp(GeorColormap colorSeeds, java.math.BigDecimal[] rampSteps, java.lang.String cellValueType, java.lang.String interpoParam) throws java.lang.Exception
colorSeeds
- An SDO_GEOR_COLORMAP object with the seed values to be used as the beginning and end values for the interpolation. Should contain at least two groups, each containing a pixel value and set of RGBA values. (RGBA = red, green, blue, alpha)rampSteps
- An array where each item indicates how many interpolated values will be generated for each section of the color ramp. Should contain at least one integer value indicating how many values will be generated for each section.cellValueType
- A string indicating whether the cell values should be creates as integer or real values. The possible values for this parameter are integer (the default) or real.interpoParam
- A string specifying the interpolation method. The possible values are method=linear (the default) and method=cosine.java.lang.Exception
public void setMaxMemSize(java.lang.Long maxMemSize) throws java.lang.Exception
maxMemSize
- Number of bytes that can be used for managing memory using the GeoRaster buffer system. The default value is 16777216 (16 MB).java.lang.Exception
public long getMaxMemSize() throws java.lang.Exception
java.lang.Exception
public void setReadBlockMemSize(java.lang.Long memBlockSize) throws java.lang.Exception
memBlockSize
- Number of bytes that can be used for the GeoRaster internal data block for read-only operations. The default value is 32768 (32k).java.lang.Exception
public void setWriteBlockMemSize(java.lang.Long memBlockSize) throws java.lang.Exception
memBlockSize
- Number of bytes that can be used for the GeoRaster internal data block for read/write operations. The default value is 65536 (64 K).java.lang.Exception
public long getReadBlockMemSize() throws java.lang.Exception
java.lang.Exception
public long getWriteBlockMemSize() throws java.lang.Exception
java.lang.Exception
public GeorGrayscale generateGrayRamp(GeorGrayscale grayScale, java.math.BigDecimal[] rampSteps, java.lang.String cellValueType, java.lang.String interpoParam) throws java.lang.Exception
grayScale
- An SDO_GEOR_GRAYSCALE object with the seed values to be used as the beginning and end values for the interpolation. Should should contain at least one pixel-value/gray-value pair.rampSteps
- An array where each item indicates how many interpolated values will be generated for each section of the gray ramp. Should contain at least one integer value indicating how many values will be generated for each section of the gray ramp.cellValueType
- A string indicating whether the cell values should be creates as integer or real values. The possible values for this parameter are integer (the default) or real.interpoParam
- A string specifying the interpolation method. The possible values are method=linear (the default) and method=cosine.java.lang.Exception