Raster datasets and raster catalogs in a geodatabase in DB2

Raster data is spatial data represented in an array of equally sized cells arranged in rows and columns. Raster data can be made up of one or more raster bands. For a complete explanation of raster data and its attributes, see the "Understanding raster data" book in this help. You can start with What is raster data?

Rasters in ArcGIS Desktop

In ArcGIS, raster data can be stored in a single raster dataset, raster catalog, or mosaic dataset. For a description of these types of raster storage, see Raster data organization.

In the Catalog tree, individual raster datasets in DB2 have the following icon:

Raster dataset icon

A raster catalog in the Catalog tree has the following icon:

Raster catalog icon

The names of raster catalogs and raster datasets in DB2 contain the name of the database, the name of the owner of the raster catalog or dataset, and the name of the raster catalog or raster dataset itself.

For example, a raster dataset, world, owned by user rock, in the global database would be listed as GLOBAL.ROCK.WORLD in the Catalog tree.

For information on how mosaic datasets are stored in a geodatabase, see Mosaic datasets in a geodatabase in DB2.

Raster tables in an IBM DB2 database

ArcSDE geodatabases in a DB2 database store raster data in DB2's native binary format.

The DB2 native binary format is similar to the ArcSDE compressed binary type. See your DB2 documentation and ArcSDE compressed binary storage for more information on the binary type. A raster column is added to a business table, and each cell of the raster column contains a reference to a raster stored in a separate raster table. Therefore, each row of a business table references an entire raster.

When you import a raster into an ArcSDE geodatabase, a raster column is added to the business table of your choice. Each cell of the raster column contains a reference to a raster stored in a separate raster table. Therefore, each row of a business table references an entire raster. ArcSDE restricts one raster column per business table.

TipTip:

You can name the raster column whatever you like, as long as it conforms to DB2's column naming convention.

A raster dataset that uses DB2 native binary storage is made up of five tables: the business table, auxiliary, block, band, and raster attribute tables. The following are the business and raster tables for a raster dataset called WORLD_TIF.

The WORLD raster dataset tables in DB2

The number in the names of the SDE_BLK, SDE_AUX, SDE_RAS, and SDE_BND tables corresponds to the RASTERCOLUMN_ID in the RASTER_COLUMNS table.

Given the nature of raster data, databases that contain rasters tend to be quite large. Raster datasets and raster catalogs are rarely less than a few gigabytes (GB) and can occupy several terabytes (TB) within your DBMS. Coping with the large size of raster data can, therefore, be a challenge. For recommendations and examples of how to manage your raster data in an ArcSDE geodatabase, see the white paper, Raster Data in ArcSDE, which can be downloaded from the ArcSDE support site at support.esri.com.

The business table

The business table is a DBMS table that stores attributes and is spatially enabled by adding a raster column. It stores the footprint (delineates the area) of the raster. In the example above, the business table is the WORLD_TIF table.

A business table with a raster column is a raster dataset or a raster catalog. A raster dataset can have only one business table row, while a raster catalog can have more than one. Information about the raster column is maintained in the RASTER_COLUMNS system table. Information about all business tables, regardless of whether they have a spatial column or raster column, is maintained in the TABLE_REGISTRY system table.

Raster image tables

The actual raster images are stored in these tables.

NoteNote:

The raster tables are only present in your database if you have raster data in the geodatabase.

SDE_AUX_<raster_column_ID>

The raster auxiliary table stores the image color map; image statistics; and the optional bit mask, which is used for image overlays and mosaicking.

ArcSDE automatically stores any existing image metadata, such as image statistics, color maps, or bit masks in the raster auxiliary table. The rasterband_id column of the raster auxiliary table is a foreign key reference to the primary key of the raster bands table. ArcSDE joins the two tables on this primary/foreign key reference when accessing the metadata of a raster band.

Field name

Field type

Description

Null?

RASTERBAND_ID

INTEGER

A number that represents a raster band; for example, a raster dataset with two raster bands would have two different values in this field—1 and 2.

NOT NULL

TYPE

INTEGER

Values include

2 = raster statistics

3 = colormap

4 = coordinate transformation

5 = reserved for geodatabase

6 = miscellaneous

NOT NULL

OBJECT

BLOB

Contains the actual data, either a colormap index, raster statistics, or coordinate transformation

NOT NULL

SDE_BLK_<raster_column_ID>

The raster blocks table stores the actual image data for each band of the image.

The raster blocks table stores the pixels of each raster band. ArcSDE tiles the pixels into blocks according to a user-defined dimension. ArcSDE does not have a default dimension; however, applications that store raster data in ArcSDE geodatabases do. Geoprocessing tools and ArcCatalog, for example, use default raster block dimensions of 128 by 128 pixels per block. The dimensions of the raster block, along with the compression method if one is specified, determine the storage size of each raster block. You should select raster block dimensions that, combined with the compression method, allow each row of the raster block table to fit within the DBMS.

The raster blocks table contains the RASTERBAND_ID column, which is a foreign key reference to the raster band table's RASTERBAND_ID primary key. These tables are joined together on the primary/foreign key reference when accessing the blocks of the raster bands.

For DB2 on Linux, UNIX, and Windows, you should create a very large table space to store the raster blocks (BLK) table and create a second, medium-sized table space to store the remaining raster tables and indexes.

When you create the table spaces for the raster blocks table in DB2, it is recommended you use an extent size of 64. The extent size specifies the number of page-size pages that will be written to a container before proceeding to the next container. The extent size is defined at the time of table space creation and cannot be easily modified afterward.There is an additional type of raster table—the raster attribute table. These tables store attribute values based on cell values in the raster.

The raster blocks table is populated according to a declining resolution pyramid. The height of the pyramid is determined by the number of levels, specified by application. The application, such as geoprocessing tools or ArcCatalog, might allow you to define the levels, request that ArcSDE calculate them, or offer both choices. The pyramid begins at the base, or level 0, which contains the original pixels of the image. The pyramid proceeds toward the apex by coalescing four pixels from the previous level into a single pixel at the current level. This process continues until ArcSDE reaches the apex, which may be automatically defined or user defined.

The additional levels of the pyramid increase the number of raster blocks by as much as one-third. However, since you can specify the number of levels, the size of the pyramid can be less. The first level of the pyramid will be 25 percent of the base. It should also be noted that the first level of the pyramid can be skipped, a factor that can greatly reduce the size of the pyramid.

A raster pyramid
A raster pyramid

When you build a pyramid, more rasters are created by progressively downsampling the previous level by a factor of two until the apex. As the application zooms out and the raster cells grow smaller than the resolution threshold, ArcSDE selects a higher level of the pyramid. The purpose of the pyramid is to optimize display performance.

Field name

Field type

Description

Null?

RASTERBAND_ID

INTEGER

A number that represents a raster band; for example, a raster dataset with two raster bands would have two different values in this field—1 and 2.

NOT NULL

RRD_FACTOR

INTEGER

Pyramid level; pyramid levels begin at 0 and can increase from there.

NOT NULL

ROW_NBR

INTEGER

Tile row number position

NOT NULL

COL_NBR

INTEGER

Column row number position

NOT NULL

BLOCK_DATA

BLOB

Pixel data stored in the tile

NOT NULL

SDE_BND_<raster_column_id>

The raster band table stores information about the bands of the images. There is one record for each raster band.

ArcSDE geodatabases store raster bands in the raster bands table. ArcSDE joins the raster bands table to the raster table on the RASTER_ID column. The RASTER_ID of the raster band table column is a foreign key reference to the raster table primary key.

Field name

Field type

Description

Null?

RASTERBAND_ID

INTEGER

A number that represents a raster band; for example, a raster dataset with two raster bands would have two different values in this field—1 and 2.

NOT NULL

SEQUENCE_NBR

INTEGER

Sequence of the raster band within the raster dataset

NOT NULL

RASTER_ID

INTEGER

The unique identifier of the raster dataset; corresponds to the value in the raster column of the business table

NOT NULL

NAME

VARCHAR(65)

The optional raster band name

BAND_FLAGS

INTEGER

A bitmask containing properties about the band

NOT NULL

BAND_WIDTH

INTEGER

The pixel width of the band

NOT NULL

BAND_HEIGHT

INTEGER

The pixel height of the band

NOT NULL

BAND_TYPES

INTEGER

A bit mask containing properties about the band

NOT NULL

BLOCK_WIDTH

INTEGER

The pixel width of a block

NOT NULL

BLOCK_HEIGHT

INTEGER

The pixel height of a block

NOT NULL

BLOCK_ORIGIN_X

DOUBLE

The x-coordinate of the raster origin

NOT NULL

BLOCK_ORIGIN_Y

DOUBLE

The y-coordinate of the raster origin.

NOT NULL

EMINX

DOUBLE

The minimum x-value of a raster band

With eminy, emaxx, and emaxy, it defines the envelope of a raster band.

NOT NULL

EMINY

DOUBLE

The minimum y-value of a raster band

With eminx, emaxx, and emaxy, it defines the envelope of a raster band.

NOT NULL

EMAXX

DOUBLE

The maximum x-value of a raster band

With eminx, eminy, and emaxy, it defines the envelope of a raster band.

NOT NULL

EMAXY

DOUBLE

The maximum y-value in a raster band

With eminx, eminy, and emaxx, it defines the envelope of a raster band.

NOT NULL

CDATE

INTEGER

The creation date of the raster band

NOT NULL

MDATE

INTEGER

The last modification date of the raster band

NOT NULL

SDE_RAS_<raster_column_id>

The raster description table stores the description of the images within a raster column.

Field name

Field type

Description

Null?

RASTER_ID

INTEGER

The unique identifier of the raster dataset; corresponds to the value in the raster column of the business table

NOT NULL

RASTER_FLAGS

INTEGER

Reserved for future use

DESCRIPTION

VARCHAR(65)

The description of the raster dataset

Other system tables to track rasters

Like other types of data, raster catalogs and datasets are tracked in the GDB_ITEMS and LAYERS tables. Columns of type raster are tracked in the RASTER_COLUMNS table—there is one entry for every table containing a raster column.

There can be additional attribute tables as part of the raster dataset or raster catalog. There would only ever be one raster attribute table per raster dataset, but raster catalogs could have several such tables. The raster attribute tables are used to define attributes for particular raster cell values. See Raster dataset attribute tables for information on using these tables.

You can use the Build Raster Attribute tool of the Raster Properties toolset in the Raster toolset of the Data Management toolbox. See the topic Build Raster Attribute Table (Data Management) for details on this tool.

For raster datasets, the additional attribute tables are named in the format SDE_VAT_<raster_column_ID>. For raster catalogs, the table name is in the format SDE_VAT_<raster_column_ID>_<Object_ID>.

View a diagram of a raster dataset in DB2.

NoteNote:

You need Adobe Acrobat Reader to open the file.

Dashed lines indicate implicit relationships between columns, solid lines mean the relationships are explicitly defined, gray tables are views.

Rasters in an XML document

Raster datasets are enclosed in DataElement tags in an XML document. The tags have the value "esri:DERasterDataset".

The following is an entry for the WORLD_TIF raster dataset:

     <DataElement xsi:type="esri:DERasterDataset">
       <CatalogPath>/V=sde.DEFAULT/RD=global.ROCK.world_TIF</CatalogPath> 
       <Name>global.ROCK.world_TIF</Name> 
       <Children xsi:type="esri:ArrayOfDataElement">
          <DataElement xsi:type="esri:DERasterBand">
            <CatalogPath>/V=sde.DEFAULT/RD=global.ROCK.world_TIF/RB=Band_1</CatalogPath> 
            <Name>Band_1</Name> 
            <DatasetType>esriDTRasterBand</DatasetType> 
            <DSID>-1</DSID> 
            <Versioned>false</Versioned> 
            <CanVersion>false</CanVersion> 
            <HasOID>true</HasOID> 
            <OIDFieldName>ObjectID</OIDFieldName> 
            <Fields xsi:type="esri:Fields">
              <FieldArray xsi:type="esri:ArrayOfField">
                <Field xsi:type="esri:Field">
                    <Name>ObjectID</Name> 
                    <Type>esriFieldTypeOID</Type> 
                    <IsNullable>false</IsNullable> 
                    <Length>4</Length> 
                    <Precision>0</Precision> 
                    <Scale>0</Scale> 
                    <Required>true</Required> 
                    <Editable>false</Editable> 
                </Field>
                <Field xsi:type="esri:Field">
                    <Name>Value</Name> 
                    <Type>esriFieldTypeInteger</Type> 
                    <IsNullable>true</IsNullable> 
                    <Length>0</Length> 
                    <Precision>0</Precision> 
                    <Scale>0</Scale> 
               </Field>
               <Field xsi:type="esri:Field">
                    <Name>Count</Name> 
                    <Type>esriFieldTypeInteger</Type> 
                    <IsNullable>true</IsNullable> 
                    <Length>0</Length> 
                    <Precision>0</Precision> 
                    <Scale>0</Scale> 
               </Field>
             </FieldArray>
         </Fields>
         <Indexes xsi:type="esri:Indexes">
           <IndexArray xsi:type="esri:ArrayOfIndex" /> 
         </Indexes>
         <IsInteger>true</IsInteger> 
         <MeanCellHeight>0.175996089009095</MeanCellHeight> 
         <MeanCellWidth>0.176000337991447</MeanCellWidth> 
         <Height>1024</Height> 
         <Width>2048</Width> 
         <PixelType>U8</PixelType> 
         <PrimaryField>1</PrimaryField> 
         <TableType>esriRasterTableValue</TableType> 
         <Extent xsi:type="esri:EnvelopeN">
            <XMin>-179.906382261841</XMin> 
            <YMin>-90.1303147686327</YMin> 
            <XMax>180.542309944643</XMax> 
            <YMax>90.089680376681</YMax> 
            <SpatialReference xsi:type="esri:GeographicCoordinateSystem">
   <WKT>GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984", SPHEROID["WGS_1984",6378137.0,298.257223563]], PRIMEM["Greenwich",0.0], UNIT["Degree",0.0174532925199433]]</WKT> 
          <XOrigin>-400</XOrigin> 
          <YOrigin>-400</YOrigin> 
          <XYScale>11258999068426.2</XYScale> 
          <ZOrigin>0</ZOrigin> 
          <ZScale>1</ZScale> 
          <MOrigin>0</MOrigin> 
          <MScale>1</MScale> 
          <XYTolerance>8.98315284119521E-09</XYTolerance> 
          <ZTolerance>2</ZTolerance> 
          <MTolerance>2</MTolerance> 
          <HighPrecision>true</HighPrecision> 
          <LeftLongitude>-180</LeftLongitude> 
         </SpatialReference>
        </Extent>
      </DataElement>
    

11/18/2013