To retrieve a raster column metadata, the following method should be
employed.
SeRasterColumn rasterColumn; System.out.println("\nDisplaying
Raster Column " + rasterColumn.getName() + " info: ");
System.out.println("Raster Layer ID: " + rasterColumn.getID().longValue());
System.out.println("Description: " + rasterColumn.getDescription());
System.out.println("Table Name: " + rasterColumn.getQualifiedTableName());
System.out.println("Raster Column: " + rasterColumn.getName());
System.out.println("Minimum Raster ID: " +
rasterColumn.getMinID().longValue());
System.out.println("Creation Date: " +
rasterColumn.getCreationDate().toString());
System.out.println("Config. Keyword: " +
rasterColumn.getConfigurationKeyword());
System.out.println("Privileges: " +
convPrivilegesToString(rasterColumn.getAccess()).toUpperCase());
if (rasterColumn.hasGdbType())
{
System.out.println("Has GDB Type");
int gdbType = (int) rasterColumn.getGdbType();
if (((int) rasterColumn.getGdbType() & rasterColumn.SE_GDBTYPE_RASTERMAP)
== rasterColumn.SE_GDBTYPE_RASTERMAP)
System.out.println("GDB Type:RasterMap");
else
System.out.println("GDB Type:None");
}
else
{
System.out.println("Does not have GDB Type.");
}
//BaseRasterColumnId ?
SeCoordinateReference cRef = rasterColumn.getCoordRef();
if(cRef != null)
{
System.out.println("");
displayCoordRef (cRef);
} /** */
public static String convPrivilegesToString(int privileges)
{
StringBuffer privilege_str = new StringBuffer(40);
if((privileges & SeDefs.SE_SELECT_PRIVILEGE) ==
SeDefs.SE_SELECT_PRIVILEGE)
{
privilege_str =
privilege_str.append(",Select");
}
if((privileges & SeDefs.SE_UPDATE_PRIVILEGE) ==
SeDefs.SE_UPDATE_PRIVILEGE)
{
privilege_str =
privilege_str.append(",Update");
}
if((privileges & SeDefs.SE_INSERT_PRIVILEGE) ==
SeDefs.SE_INSERT_PRIVILEGE)
{
privilege_str =
privilege_str.append(",Insert");
}
if((privileges & SeDefs.SE_DELETE_PRIVILEGE) ==
SeDefs.SE_DELETE_PRIVILEGE)
{
privilege_str =
privilege_str.append(",Delete");
}
if (privilege_str.length() > 1)
{
return ((String)
privilege_str.substring(1));
}
else
{
return ((String) "".toString());
}
}
synchronized public static void displayCoordRef(SeCoordinateReference
cRef) throws SeException
{
if(cRef == null)
return;
System.out.println("XY Offset: " + cRef.getFalseX() + ", " +
cRef.getFalseY());
System.out.println("XY Scale Factor: " + cRef.getXYUnits());
System.out.println("Z Offset: " + cRef.getFalseZ());
System.out.println("Z Scale Factor: " + cRef.getZUnits());
System.out.println("Measure Offset: " + cRef.getFalseM());
System.out.println("Measure Scale Factor: " + cRef.getMUnits());
SeExtent ext = cRef.getXYEnvelope();
System.out.println("Envelope: ");
System.out.println(" MinX: " + ext.getMinX() + " MaxX: " +
ext.getMaxX());
System.out.println(" MinY: " + ext.getMinY() + " MaxY: " +
ext.getMaxY());
System.out.println(" MinZ: " + ext.getMinZ() + " MaxZ: " +
ext.getMaxZ());
System.out.println("Z Values --> Min: " + cRef.getMinZValue()
+ " Max: " + cRef.getMaxZValue());
System.out.println("Measure Values --> Min: " +
cRef.getMinMValue() + " Max: " + cRef.getMaxMValue() );
System.out.println("Spatial Reference ID: "+cRef.getSrid().longValue());
System.out.println("Coordinate System: "+cRef.getCoordSysDescription());
} |
|