A raster column in ArcSDE is a column in the business table that contains a reference
to associated raster data.
When inserting a raster to a database, ArcSDE adds a record to the Raster_Column system table that is maintained in the sde user's
schema. This Raster_Column table contains the name of the business table as one
of its fields (see schema) and stores an integer ID in the business table that
is actually a foreign key to the Raster table.
Creating a raster column
Step 1. Create a table
Step 2. Instantiate SeRasterColumn object and set its attributes as follows:
LONG rc, ras_col_id; //rc = return_code
SE_RASCOLINFO rascol_info;
SE_CONNECTION connection;
rc = SE_rascolinfo_create (&rascol_info);
rc = SE_rascolinfo_set_minimum_id (rascol_info, 10);
rc = SE_rascolinfo_set_creation_keyword (rascol_info,
"DEFAULTS");
rc = SE_rascolinfo_set_raster_column (rascol_info, table,
"RASTER");
rc = SE_rascolinfo_set_coordref (rascol_info, coordref);
rc = SE_rascolinfo_set_description (rascol_info, "NONE");
/* Create Raster Column */
rc = SE_rastercolumn_create (connection, rascol_info);
SeConnection conn = ......;
String tableName = .......
String rasterColumnName = "Raster";
SeRasterColumn rasterLayer = new SeRasterColumn(conn);
rasterLayer.setTableName(tableName);
rasterLayer.setRasterColumnName(rasterColumnName);
rasterLayer.setDescription("Raster Column Layer Description");
rasterLayer.setGdbType(SeRasterColumn.SE_GDBTYPE_RASTERMAP);
rasterLayer.setMinID(new SeObjectId(1));
//Define the layer's Coordinate Reference (optional)
SeCoordinateReference coordref = new SeCoordinateReference ();
coordref.setXY (0,0,100);
rasterLayer.setCoordRef (coordref);
rasterLayer.create();
// Now, get the latest layer info.
rasCol = new SeRasterColumn(conn, tableName, "RASTER");
//In second case, raster column attributes should be set after instantiating
the object.
|
Deleting a raster column
LONG rc, ras_col_id; //rc = return_code
SE_RASCOLINFO rascol_info;
rc = SE_rastercolumn_delete(connection, table_name, raster_column);
rc = SE_rascolinfo_free(rascol_info);
SeRasterColumn rasterLayer = ......;
rasterLayer.delete();
//Deleting Table
table.delete();
|
|