sderaster

The sderaster command manages raster layers. For general concepts regarding the storage and manipulation of ArcGIS raster data and specific information regarding the storage of raster data in a geodatabase, refer to the ArcGIS Desktop Help.

Usage syntax

sderaster -o add -l <table,column> [<-M minimum_id>]
[-G {<projection id> | file=<projection file>}]
[-type={default | blob | georaster | st_raster}]
[-k <config_keyword>] [-S <description_str>]
[-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>]
[-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o alter -l <table,column> [-M <minimum_id>]
[-G {<projection id> | file=<projection file>}] [-S <description_str>]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] [-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o colormap -l <table,column> -v <raster_id>
{-d | {-f <image_file> | <database raster>}}
[-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>]
[-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o copy -l <table,column> [-g][-N]
[-V <version_name>] [-n <image_name>] [-M <minimum_id]
[-rasterbufsize=<size>] [-G {<projection id> | file=<projection file>}]
[-k <config_keyword>] [-type={default | blob | georaster | st_raster}]
[-P <description_str>] [-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>] [-u <DB_user_name>]
[-p <DB_user_password>] <database raster>
 

sderaster -o delete -l <table,column>
{-v <raster_id>|-W <whereclause>} [-y] [-V <version_name>]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] [-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o describe [-l <table,column> | -t <table>]
[-verbose] [-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] [-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o drop {-l <table,column> | -t <table> } [-y]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name> ]
[-D <database_name> ] [-u <DB_user_name> ]
[-p <DB_user_password>]
 

sderaster -o export -l <table,column> -v <raster_id>
[-I] [-V <version_name>] [{-w | -e} <minx,miny,maxx,maxy>]
[-c {lzw | packbits | g3 | g4}] [-b <band_number>] [-L <pyramid_level>]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] [-u <DB_user_name>}]
[-p <DB_user_password>] <image file>
 

sderaster -o import -l <table,column> [-g] [-N]
[-Align] [-log=<file_name>] [-interleave={separate | contiguous}]
[-rasterbufsize=<size>] [-c {lz77 | jpeg | jp2}]
[-q {<quality> | bitrate = <bit_rate>}]
[-C {rgb | grayscale}] [{-R <border>:<tolerance> | -a <NoData>}]
[-n <image_name>] [-M <minimum_id]
[-G {<projection id> | file=<projection file>}]
[-O <minx,maxy> | file=<list file>}]
[-type={default | blob | georaster | st_raster}]
[-k <config_keyword>] [-P <description_str>] [-L <pyramid_level>]
[-I {nearest | bilinear | bicubic}] [-t <tile_width,tile_height>]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] [-u <DB_user_name>] [-p <DB_user_password>]
{-f <image_file> | <database raster>}
 

sderaster -o insert -l <table,column> [-N] [-Align] [-log=<file name>]
[-interleave={separate | contiguous}] [-rasterbufsize=<size>]
[-c {lz77 | jpeg | jp2}] [-q {<quality> | bitrate=<bit_rate>}]
[-V <version_name>] [-C {rgb | grayscale}]
[{-R <border>:<tolerance> | -a <NoData>}]
[-n <image_name>] [-L <pyramid_level>]
[-I {nearest | bilinear | bicubic}]
[-t <tile_width, tile_height>]
[-G {<projection_ID> | file=<proj_file>}]
[-O <minx,maxy> | file=<list file>]
[-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>]
[-u <DB_user_name>] [-p <DB_user_password>]
{-f <image_file> | <ArcSDE raster>}
 

sderaster -o list -l <table,column> [-verbose] [-storage]
[-v <raster_id> [-L <pyramid_level>] | -W <where>}]
[-V <version_name>] [-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>]
[-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o mosaic -l <table,column> -v <raster_id>
[-N][-Align] [-norebuild] [-log=<file name>]
[-rasterbufsize=<size>] [-V <version_name>]
[-C {rgb | grayscale}] [-q {<quality> | bitrate = <bit_rate>}]
[-T] [{-R <border>:<tolerance> | -a <NoData>}]
[-m {merge | delete}] [-n <image_name>]
[-L <pyramid_level>] [-I {nearest | bilinear | bicubic}]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] [-u <DB_user_name>] [-p <DB_user_password>]
{-f <image_file> | <database raster>}
 

sderaster -o pyramid -l <table,column> -v <raster_id>
[-log=<file name>] [-V <version_name>] [-L <pyramid_level>,[skipLevel1]]
[-I {nearest | bilinear | bicubic}] [-q {<quality> | bitrate=<bit_rate>}]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] [-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o stats -l <table,column> -v <raster_id> [-d]
[-L <pyramid_level>] [-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>]
[-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o truncate -l <table,column> [-y]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name> ]
[-D <database_name>] [-u <DB_user_name>] [-p <DB_user_password>]
 

sderaster -o update -l <table,column> -v <raster_id> [-N]
[-Align] [-log=<file name>] [-interleave={separate | contiguous}
[-rasterbufsize=<size>] [-V <version_name>] [-c {lz77 | jpeg | jp2}]
[-q {<quality> | bitrate = <bit_rate>}] [-C {rgb | grayscale}]
[{-R <border>:<tolerance> | -a <NoData>}] [-n <image_name>]
[-L <pyramid_level>] [-I {nearest | bilinear | bicubic}]
[-t <tile_width,tile_height>] [-G {<projection_ID> | file=<proj_file>}]
[-O <minx,maxy>] [-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>] [-u <DB_user_name>]
[-p <DB_user_password>] {-f <image file> | <database raster>}
 

sderaster -h or -?

sderaster -H <operation>
 

Operations

Operation Description Example
add Creates a raster layer by adding a raster column to a business table Add a raster column to a table
alter Alters either the coordinate reference, minimum ID, or raster column description

Use the alter operation to change the coordinate system, minimum ID value, or description string.

The coordinate system can be changed if the image was created with one. If the image was created without a coordinate system, you will receive the error: "Error: No coordref defined on the original raster layer". Images created without coordinate reference systems do not have an extent, and for that reason, a coordinate system cannot be applied after the fact.

Usually, coordinate reference systems are changed for images that have a coordinate reference system originally set to UNKNOWN. Setting the coordinate reference system to UNKNOWN requires you to enter the extent of the image, which you can collectively obtain from the source images. Later, you can alter the coordinate reference.

Alter the properties of a raster layer
colormap Updates a raster's color map Create a color map on a raster
copy Duplicates a raster, including pyramid, image statistics, and color map data

The copy operation provides a complete duplicate of another geodatabase raster dataset or raster catalog. The image pyramid, the image statistics, and color map are copied with the rasters. The copy operation is unlike the import operation since the import operation only duplicates the pixel data without the pyramid. You can limit the rasters that are copied by applying a WHERE clause.

Copy a raster layer
delete Deletes a raster from a raster layer

The delete operation allows you to remove a raster from a raster layer.

Delete a raster
describe Describes one or all raster layers owned by a user

To obtain the properties of the raster layer, use the describe operation. With the describe operation, if you do not specify a raster layer, the properties of all raster columns are returned. Note that the raster layer ID property listed by the describe operation is not the argument to be entered with the operations that require you to enter a raster ID following a -v option. The raster layer ID identifies the raster layer. The raster ID identifies an individual raster within the column. The raster ID of a raster can be obtained from the list operation by listing all the rasters of a raster layer.

Describe raster columns
drop Drops a raster column or business table

Use the drop operation to drop a raster layer. Dropping a raster layer drops the supporting raster tables that store the raster data and deletes the raster layer's reference from the sde.raster_columns table.

Drop a raster layer
export Exports raster from a layer

A raster can be exported to a file with the export operation. If the raster is compressed, it will expand when it is exported to a tagged image file format (TIFF), GeoTIFF, or band sequential (BSQ) file and you might inadvertently exhaust the disk space to which the file is written. The sderaster command will return the following error if it runs out of disk space: "TIFFAppendToStrip: <file name>.tif: Write error at scanline <n>." To avoid running out of disk space, use sderaster -o list to determine if the raster has been compressed and, as a general rule, multiply the stored size by 2 for LZ77 and 5 for JPEG and JPEG 2000.

To obtain the stored size of a raster, use the -o list operation and include the -storage option. Depending on the size of the rasters, this option may require a significant amount of time to complete. You can also apply a compression if the output format is TIFF. By specifying the -c option, you can compress the TIFF file with either LZW, packbits, g3, or g4 compression.

The maximum output size of a BSQ image file is limited by the current operating system's capability. For AIX, BSQ image files must be smaller than 2 GB. The maximum size of a TIFF or GeoTIFF file is limited to 4 GB.

When exporting GeoTIFF files, a world file is not usually generated because the spatial reference is stored in the GeoTIFF header. However, if a user-defined spatial reference is used for the file, it will not be possible to match the spatial reference information with the GeoTIFF standard format. If this case should occur, a world file will be created along with the GeoTIFF file to store the extent of the raster.

Export a raster
import Imports a raster layer

Use the import operation to convert an image file to a raster layer. Be sure to include the -c option to compress the data and the -g option if you want to access the raster layer as a raster dataset from ArcCatalog or ArcMap. Do not use the -g option if you intend to add rows to the raster layer and treat the raster layer as an ArcGIS raster catalog.

The import operation supports the standard baseline TIFF and BSQ image file formats. To be georeferenced, the image files must be accompanied by a world file. Those that do not include a world file will be registered at the 0,0 coordinate and mosaics will not be allowed following the import operation. The sderaster command does not support YCbCr TIFF images. ArcCatalog supports this format, however.

Beginning with ArcSDE 9.3, GeoTIFF format is also supported. When these types of files are imported, the raster extent and projection are read from the header of the GeoTIFF file, unless the spatial reference for the file is user-defined and necessitates the presence of a world file.

Use the -O option to specify a virtual origin if you intend to follow the import operation with the mosaic operations to create a large raster. Use the -Align option if the virtual origin is not cell aligned with the image origin as specified by the coordinates with the image's world file. The -Align option will shift image origin within half a pixel cell to agree with the virtual origin you specify. Cell alignment must agree within 14 decimal degrees of freedom to be considered cell aligned.

The following BSQ header file standard tags are recognized by sderaster:

BYTEORDER
NROWS
NCOLS
NBANDS
NBITS
BANDROWBYTES

Extended tags are as follows:

  • COLORMAP [value]

    Where [value] is the number of entries in the color map.
  • PIXELTYPE [type]

    Where [type] is one of the following:

    1bit
    4bit
    uint8
    int8
    uint16
    int16
    uint32
    int32
    float
    double
  • MASK [value]

    Where [value] indicates whether or not a bitmask is present (1 if it is present, 0 if it is not).

    You can manipulate the bitmask of a raster by creating a bitmask file to accompany the image file during an import operation. See the "Discussion" section for details.

Import an image
insert Inserts a raster into a raster layer

The insert operation allows you to insert images into a raster layer. Include the -c option to compress the data upon entry. See the discussion on the import operation for supported image formats.

When executing the insert operation, sderaster checks the source and destination coordinate references (including unknown and NULL) and returns an error if the source and destination coordinate references do not match.

You can manipulate the bitmask of a raster by creating a bitmask file to accompany the image file during an insert operation. See the "Discussion" section for details.

Insert images
list Lists one or all rasters in a raster layer

The list operation returns information about the individual rows of a raster column.

List information
mosaic Performs piecewise updates on a raster

The mosaic operation with the default merge mode (-m merge) allows you to integrate the data of an image with the data of an existing raster.

When set to the merge mode, the mosaic operation replaces the source pixel data values of the target raster. It only changes the target raster's NoData value for a given pixel cell location from NoData to Data if the source pixel cell's NoData value was set to Data (indicating that the pixel cell for that location has data). The bitmask file and the -a or -R options are applied to the source data before it is mosaicked to the target. Therefore, if a source pixel cell had data and the bit mask file or the -a or -R option changed it to NoData, that cell value would not replace the target value.

The mosaic operation with the delete mode (-m delete) applies the NoData values of a bitmask that you have created with the .msk extension to accompany the image file. (See the bitmask section for more information.) If the -a or -R option is included, the NoData bitmask is applied first, followed by the -a or -R option.

In delete mode, the target pixel cell is set to NoData where ever the corresponding NoData value of the bitmask is set to NoData. After the bit mask has been applied, the -a or -R option is applied to the source data, and any NoData values from that are applied to the target.

The mosaic operation requires that the raster column have a coordinate system, the images have the same cell size and alignment, and the raster not have a color map.

To mosaic images with color maps, create a raster without a color map, mosaic the images, then reapply the color map with the colormap operation. The colormap operation can also be used to remove a color map by specifying the delete option. If color maps are going to be reapplied following the mosaic operations, the nearest neighbor pyramid interpolation method should be used to construct a pyramid, since it does not generate new values but uses existing neighboring values. If the color maps of the source images are different, third-party tools can be used to create a color map for the entire mosaicked image.

An alternative to preserving the color map is to convert the 8-bit, color-mapped images into a 24-bit Trucolor image using the -C RGB option. Although this option triples the storage space requirement for the raster, it alleviates the need for you to manage the color map. In addition, more complex pyramid interpolation resampling methods (such as bilinear and bicubic) can be applied, resulting in smoother-looking pyramid levels. Combining color maps for large areas of imagery may not be possible given the fact that you are restricted to 256 color combinations in an 8-bit, single-band image. You may require the 16,777,216 (256*256*256) color combinations available under a 24-bit Trucolor image.

It is recommended that the mosaic operation be applied serially from a single session rather than in parallel from multiple sessions. Parallel applications of the mosaic operation can result in a deadlock.

The mosaic operation automatically updates the pyramid. However, it should be pointed out that the pyramid is completely rebuilt if an image is mosaicked to the left or above the raster's current image origin. A pyramid rebuild can be avoided by presetting a virtual image origin to the upper left coordinate when the raster is created. The import and insert operations both include the -O option, allowing you to do just that. The -Align option can be supplied with the mosaic operation to automatically cell align the input image with the existing rasters' cell alignment. If you create a raster with a virtual image origin, all subsequent images must be aligned with the virtual origin.

The -norebuild option can also be included with the mosaic operation. This option specifies that the pyramid is not to be rebuilt if you attempt to mosaic an image with an origin that is to the left or above the current raster image origin. In this case, an error is reported rather than allow the pyramid to be automatically rebuilt.

When executing the mosaic operation, sderaster checks the source and destination coordinate references (including unknown and NULL) and returns an error if the source and destination coordinate references do not match.

You can manipulate the bitmask of a raster by creating a bitmask file to accompany the image file during the mosaic operation. See the "Discussion" section for details.

Mosaic
pyramid Updates a raster's image pyramid

Use the pyramid operation to create or re-create the raster pyramid. If you do not specify a pyramid level, the 0 level is assumed and the pyramid is deleted. Specifying a pyramid level of -1 allows sderaster to create all the levels required to reach the apex. You can skip building the first-level pyramid by specifying skipLevel1.

Note: If raster is compressed using JPEG or JPEG 2000 and a quality value is not specified when the pyramid is constructed, the default quality value of 75 for JPEG compressed rasters and 0 for JPEG 2000 compressed values will be used. The compression quality of the base level is not applied to the pyramid. Therefore, always include the quality option with the pyramid operation whenever your data is compressed with JPEG or JPEG 2000 compression.

Create a pyramid
stats Calculates a raster's image statistics and histogram

The stats operation builds statistics for the specified raster. Certain ArcGIS Desktop tasks, such as applying a contrast stretch or classifying your data, require statistics.

ArcGIS Desktop will calculate statistics when it requires them and detects when they are not present. As an alternative to having ArcGIS Desktop calculate image statistics, you can use the sderaster stats operation to perform this task ahead of time. For some raster data, image statistics improve ArcGIS Desktop applications' default display quality. The data capture of some image data uses only a portion of the bit depth. If statistics are present, ArcGIS Desktop stretches the image data by two deviations, thus artificially extending the bit depth of the image and rendering it with a greater brightness and contrast.

For more information on the ArcGIS Desktop default display of rasters, see "Initial display properties". For more information on improving raster display speed, see "Improving raster display speed". Both of these topics can be found in the "Raster" section of ArcGIS Desktop Help.

Calculate statistics on a raster
truncate Truncates a raster layer

Use the truncate operation to delete the rasters of a raster layer but leave the raster layer schema intact. This operation is useful if you want to reload the rasters.

Remove rasters from a layer
update Updates a raster

With the update operation, you can replace one raster of a raster layer with another. This operation is useful for reentering an edited image file into a raster layer.

When executing the update operation, sderaster checks the source and destination coordinate references (including unknown and NULL) and returns an error if the source and destination coordinate references do not match.

You can manipulate the bitmask of a raster by creating a bitmask file to accompany the image file during an sderaster update operation. See the "Discussion" section for details.

Update a raster

 

Options

Options Description
-a Sets pixels with specified value as NoData pixels; that means the pixel values you specify indicate which pixels will be masked as having no data in them.

You can set NoData values for all three bands. For example, perhaps 0 represents no data in the red band, but 255 represents no data in the green and blue bands. You would specify the following:

0,255,255

-Align Directs insert, update, mosaic, and import operations to automatically align the pixels of the input image file with the origin of the raster
-c For the import, insert, and update operations, the -c option enables data compression on the raster that is generated, specifying the type of compression as either LZ77, JPEG, or JPEG 2000-based (JP2).

For the export operation, it enables data compression on the TIFF and GeoTIFF files (not BSQ), specifying the type of compression as either LZW, packbits, g3, or g4.

For JPEG and JP2 compressions, an additional -q quality argument may be supplied.

The LZ77 compression technique is a lossless compression.

The JPEG compression techniquea lossy compressioncan only be applied to continuous tone images, which include 8-bit grayscale and 24-bit (8 bit, three band) red/green/blue (RGB) images. The quality defaults to 75 but can be altered by supplying the -q argument with a quality value that may range between 0 and 100.

The JP2 compression can be applied to 8-bit, 16-bit, and 24-bit (8 bit, three band) RGB images.

The compression ratio can be expressed as a quality ranging in value between 0 and 255.

Values greater than 0 compute a lossy compression, whereas a quality value set to 0 computes a lossless compression. Thus, lower values produce smaller but visually poorer output and low-quality images, whereas higher values result in larger, higher-quality images. For JP2, the quality can also be specified as a fixed bitrate by supplying bitrate=<bit_rate> after the -q option; for example: -q bitrate=1. The fixed bitrate method specifies the actual compression ratio that will be applied, whereas a quality value applies a relative compression ratio. The default for JP2 compression is 0, lossless compression. See the "Discussion" section for details on JP2 compression options.

LZW: A lossless compression that tends to perform better than packbits.

Packbits: A simple byte-oriented run-length compression scheme

g3: Group III compression, also known as CCITT T.4 bilevel encoding

g4: Group IV compression, also known as CCITT T.6 bilevel encoding

-C rgb: This option expands a single-band, color-mapped image into a three-band RGB image, preserving the color of the original image.

Useful for mosaicking color-mapped images for which the color maps vary for each image

grayscale: This option can only be applied to 1-bit imagery, since it is used to convert single-bit, black-and-white imagery to 8-bit, grayscale imagery.

-D Database or data source name (not supported on Oracle)
-e Extraction window in world coordinates
-f The source raster specified as either a BSQ, TIFF image file, or quoted argument string that specifies a raster dataset as the source

If a quoted argument string is specified, the first quote must be followed immediately by the raster layer flag -l. No intervening white space characters are allowed between the -l flag and the first quote. At 9.2, the -f option is not required.

-g Indicates whether you intend for the raster to be a raster dataset

Including the -g option with the import or copy operations flags the raster as an ArcGIS 8.3 raster dataset. When you view the raster in ArcCatalog, it will have the raster dataset icon. To make the raster dataset a current raster dataset, register it with the geodatabase in ArcCatalog.

If you do not use the -g option, ArcGIS will interpret the raster as a table (when viewed in ArcCatalog tree, it will have a table icon). To have ArcGIS recognize the raster as a raster catalog, register it with the geodatabase.

-G Coordinate system specifier

<projection_id>: Coordinate system ID (See the pedef.h file for the integer codes.)
file=<proj_file_name>: File containing coordinate system description string

-h or -? Use either of these options to see a list of the operations that can be used with the sderaster command. If using with a C shell, you must specify "-\?" if you use the question mark option.
-H Use this option to see the usage and options for a specific operation.

For example, sderaster -H mosaic returns the syntax and options for the mosaic operation.

-i ArcSDE service name, port number, or direct connection information (default: esri_sde or 5151)
-I For the export operation, inverts 1-bit pixel data

For the update, mosaic, pyramid, and import operations, specifies the pyramid resampling interpolation method

The following are the three supported interpolation methods listed in order of complexity. As the interpolation methods become more complex, the quality of the resulting pyramid level improves at a cost of a longer execution time. Generally, the nearest neighbor interpolation level is used for single-bit pixel depths while the bilinear interpolation is used for at least 8-bit pixel depths. The bicubic interpolation method is generally reserved for 16-bit depths and higher.

nearest: The nearest neighbor method selects the closest pixel.

bilinear: The bilinear method interpolates 4 adjacent pixels.

bicubic: The bicubic method interpolates 16 adjacent pixels.

For more information on pixel resampling, see the topic "Cell size and resampling analysis" in the Spatial Analyst section of the ArcGIS Desktop help.
-interleave The type of interleave that will be used to store the data

If separate is specified, it indicates the data shall be stored in BSQ format.

The contiguous setting applies only to three-band, 8-bit data and indicates that this data shall be stored in band interleave pixel (BIP) format. Using BIP format to store three-band, 8-bit data results in higher compressed storage when JPEG compression is applied.

-k Configuration keyword present in DBTUNE table (default: DEFAULTS)

The storage parameters specific to the raster column are found under the specified keyword.

-l The raster layer's business table and raster column

If you are not the owner of the table, you must qualify the table name as owner.table.

If you are copying from one server to another, you must specify the information for the source file and the destination using two separate -l arguments; the first -l argument is the destination and the -l argument at the end of the command string is the source.

-L The pyramid level

If set to a number greater than 0, ArcSDE creates the levels specified. If set to -1, ArcSDE calculates the pyramid until the apex is obtained. If set to 0, the pyramid is deleted. If you do not specify the level, 0 is assumed.

If you specify the optional skipLevel1, the pyramid is built without the first level. Not building the first level can save storage space and time when building the pyramid, at a marginal cost to display performance.

-log The output message log file specifying the file that will receive the sderaster command output
-m Specifies the mosaic policy (merge or delete)

Merge is the default value for the -m option. Using merge replaces the overlapping values of the target raster with those of the source raster. The NoData bitmask is not affected.

Specifying delete for the -m option erases the cell value of the existing raster (changes the cell value to NoData). The following scenarios apply:

  • If the overlapping cell value of a source raster is NoData, specifying delete with the -m option causes the corresponding target cell value to be NoData.
  • If the overlapping cell value of a source raster is set to Data, -m delete has no effect on the corresponding target cell value; it remains unchanged.

When using -m delete with the mosaic operations, be aware that the source image cannot exceed the current spatial extent of the existing target raster.

-M Minimum feature ID

New raster IDs are assigned the larger of either the minimum ID or the maximum assigned ID plus one.

-n Image name
-N Ignores color map in data source and enters a grayscale image
-norebuild Specifies that the pyramid is not to be rebuilt on the dataset if you attempt to mosaic an image with an origin that is to the left or above the current raster image origin

Used only with the mosaic operation

-O The virtual origin of the raster in world coordinates

If not specified, the minimum x- and maximum y-values obtained from the image world file are applied.

Setting the virtual origin is useful if more images are going to be mosaicked to the left or above the current image extent. Setting the virtual origin to the left and above all other images that are going to be mosaicked avoids the geodatabase having to move the virtual origin. Each time the origin is moved, any existing pyramid must be reconstructed. The virtual origin can be obtained by examining the world files of the images to be mosaicked together.

-p DBMS user password
-q Compression quality for JPEG (0–100) and JP2 (JPEG 2000 based 0–255). Lower values create lower-quality rasters requiring less disk space to store.

The default quality value for JPEG is 75, which should be sufficient for most applications. In most cases, the quality value can be lowered to 40 without a noticeable change in the visual display of the image.

The compression quality parameter for JPEG 2000-based compression has a theoretical range between 0 and 255.

In practice, the recommended setting is between 50 and 150. You can also set JPEG 2000 by specifying a bitrate. For 8-bit rasters, the bitrate range is between 0 and 8. For 16-bit rasters, the bitrate range is between 0 and 16. For other pixel depths, a bitrate of 1 is commonly used. The default value for JPEG 2000 is 0.

ESRI recommends you include this option when using the import, mosaic, and pyramid operations. If you do not specify the quality you want, default values are used.

-rasterbufsize Dynamically sets the RASTERBUFSIZE storage parameter during the execution of the sderaster command without changing the storage parameter for the entire server

Increasing the RASTERBUFSIZE parameter for a raster loading session can be useful but is wasteful and unnecessary for sessions that query raster data.

-R Removes areas surrounding the raster that contain no data and usually represent a border on a raster image; for example, removes pixels with background color in a rotated image

You either specify the median pixel value and a number indicating how many pixels above and below that number are affected or you can specify a range of pixel values.

The following specifies a pixel value of 2 and 2 pixel values on either side of it (in other words, pixel values 0, 1, 2, 3, and 4):

2:2

These values will be searched for beginning left to right and will only be removed for the first occurrence of these values. Then ArcSDE reads from right to left, and removes the first pixels it encounters from that direction. That way, if you have pixel values of 3 within your image, these will not be removed and only those pixels with those values on the border of the image will be removed.

-s ArcSDE server host name (default: localhost)
-S The raster description (quoted string)
-storage Lists the storage space consumed by the raster

Note: The size given by the -storage option is the physical storage size of the raster in the database including image pyramids. This is not the same as the uncompressed size returned in ArcCatalog in the Raster Dataset Properties window, which is the uncompressed image size calculated by image dimension and pixel depth. It has nothing to do with actual storage size.

Note: Calculating storage on extremely large raster datasets (larger than 500 MB) may take several hours to complete.

-t The raster tile width and height measured in pixels

Each tile is stored as a separate raster block.

-T Enables single-user transaction (used only with the mosaic operation)

The internal commits are disabled, requiring the mosaic operation to respect the commit that occurs at the end of the mosaic operation. If the mosaic operation encounters any database management system (DBMS) issues, the entire user transaction is rolled back. The DBMS must have enough undo space to hold the changes of the entire transaction when this option is used.

Alternatively, when this option is not used, internal commits are enabled, reducing the amount of required undo space. However, a mosaic operation that fails due to a DBMS problem will only roll back to the last commit. This can result in an incomplete raster dataset.

-type The data type in which the raster data is stored

Possible values, per DBMS, are as follows:

  • DB2: blob or st_raster
  • Informix: blob or st_raster
  • Oracle: blob, st_raster, sdo_georaster, or longraw
  • PostgreSQL: bytea or st_raster
  • SQL Server: varbinarymax or st_raster

In the preceding list, the first value listed is the default value.

-u DBMS user name
-v The raster ID
-V Version name; if specified, uses only the raster data that belongs to the version (default: sde.DEFAULT)

Version names are case sensitive. For example, SDE.DEFAULT and SDE.default are different versions.

-verbose Describes all properties
-w Extraction window in pixel coordinates
-W A valid WHERE clause

Because WHERE clauses may contain spaces, the -W option must be last in the command list.

 

Discussion

The sderaster command is a command line utility for managing raster layers. The supported external raster formats are ESRI BSQ, and TIFF.

Supported TIFF types are as follows:

The GeoTIFF file format is supported by the sderaster administration command beginning with ArcSDE 9.3. You could use ArcCatalog to import this format, because it is aware of the embedded project and extent information. Or, if you use sderaster to import a GeoTIFF image, sderaster will read the raster extent and projection from the header of the GeoTIFF file. The only exception to this is if the GeoTIFF is using a user-defined spatial reference that does not match GeoTIFF standard format; in those cases, the GeoTIFF must have an accompanying world file that contains that information so sderaster can read it.

The typical scenario for using the sderaster command is to create a raster layer (a business table and associated raster tables) with the import operation followed by subsequent executions of the mosaic operation to input additional image files. Finally, the pyramid operation is applied with the level set to -1, instructing sderaster to create a full pyramid.

Be sure to include the -g option during the import operation if you want the raster to appear in either ArcCatalog or ArcMap as a raster dataset. 

Note: When loading rasters with a color map, be sure to use lossless (LZ77) compression. Using lossy compression breaks the indexing from your raster file to your color map.

The other operations of the sderaster command are used to make adjustments to the raster layer.

Bitmasks

ArcSDE uses a bitmask to determine if a pixel cell contains data or not. A bitmask value of 1 for a particular pixel cell indicates that it contains data; conversely, a bitmask value of 0 indicates that the pixel cell contains no data.

It is possible to manipulate the bitmask of an ArcSDE raster by creating a bitmask file to accompany the image file during an sderaster input operation of insert, mosaic, update, or import.

The bitmask file must be an 8-bit, single-band BSQ format representation of your source image file. Therefore, if your source image file is a three-band, 32-bit floating point, you will need to copy that file to a downsampled 8-bit, single-band BSQ format file.

The BSQ bit mask file must then be edited so that any pixel value that is 0 indicates no data when it is read by the sderaster command. All other nonzero values indicate data is present.

If the image file is BSQ format, edit the header file of the source image file. Add the keyword MASK and set it to 1. This directs sderaster to look for and load the bitmask file. The header file has an .hdr suffix. For example:

MASK    1

If the image file is TIFF format, you do not need to create and edit a header file. Rename the mask file to have the same root name as the image file but with the suffix .msk. For instance, if your image file is myimage.tif, rename the mask file myimage.msk.

Use sderaster with either the import, insert, update, or mosaic operations to bring the image file with its mask file into your geodatabase.

JPEG 2000 compression

The default JPEG 2000 compression used by ArcSDE is the variable bitrate compression algorithm. The variable bitrate algorithm operates on a scale of 1255.

The resulting image following the application of the variable bitrate algorithm strives to maintain consistent image quality but at the expense of storage space. For instance, for image areas with high variability in pixel values, such as an urban area or forest, more space is devoted to encoding the pixel data. Conversely, areas that typically show less variability, such as water bodies, use less space for encoding pixel data. Therefore, when you use the variable bitrate compression algorithm, lower compression ratios are achieved for areas of high pixel value variability and higher compression ratios are achieved for areas of low pixel value variability.

By default, sderaster applies a variable bitrate when building pyramids.

If you use JPEG 2000 compression, you have the option to use fixed bitrate compression. The fixed bitrate compression algorithm operates on a scale that depends on the bit depth of the raster dataset. For 8-bit raster datasets, the scale is greater than 0 but less than 8 bits. For 16-bit raster datasets, the scale is greater than 0 but less than 16 bits.

To achieve a 20:1 compression ratio on an 8-bit raster dataset, divide 8 by 20 to obtain a fixed bitrate of 0.4.
To achieve a 20:1 compression ratio on a 16-bit raster dataset, divide 16 by 20 to obtain a fixed bitrate of 0.8.

To apply the fixed bitrate JPEG 2000 compression with sderaster instead of variable bitrate compression, use the -q option to specify the fixed bitrate.

For example, to achieve a 20:1 compression ratio on an 8-bit raster, specify 0.4 for the bitrate, as shown below:

sderaster -o import -l testrd,raster -c jp2 -q bitrate=0.4 OP2006_12436_NC.tif

Applying the -q bitrate=<N> option during the mosaic operation constructs the pyramids with the same bitrate across the image.

The fixed bitrate algorithm strives to obtain a consistency in storage space usage at the expense of quality. An area of highly variable pixel values, such as an urban area, is be treated the same as a less variable area, such as a lake, to achieve a uniform compression ratio across the entire image.

When using fixed bitrate compression, using tile sizes greater than the default 128 by 128 pixels provides a higher quality output. A tile size of 256 by 256 pixels should be adequate. If you use 128 by 128, you will probably see artifacts at the tile boundary.

Note: ArcGIS Desktop does not support fixed bitrate rasters.

 

Examples

Add a raster column to a table

In the example below, the raster column is added to the empty table topo. The DBTUNE configuration keyword contains the storage configuration for the tables and indexes ArcSDE creates to support the raster column. For more information about DBTUNE configuration keywords, consult the topic "What are DBTUNE configuration keywords and parameters" in the ArcGIS Desktop or ArcGIS Server Help, which can be accessed from the ESRI Resource Center.

sderaster -o add -l topo,image -k topo -S "topographic series 11" -u gis1

Connecting to server ultra, port 7000, as user gis1

Creating raster layer: topo.image

Complete...

Alter the properties of a raster layer

In this example, the coordinate system is changed to North American Datum 1983.

sderaster -o alter -l topo,image -u gis1 -G 4269


Connecting to server ultra, port 7000, as user gis1

Altered.

Complete...

Create a color map on a raster

Update the color map of a raster with the colormap operation.

sderaster -o colormap -l topo,image -v 763 -f topo_049.tif -u gis1

Specifying the -d option deletes the raster's color map, while the -f option updates the color map with the contents of an image file or another raster.

Copy a raster layer

In this example, a copy is made of the raster dataset carto_copy to a new raster dataset, topo. The pyramid, statistics, and color map of topo are copied, but only rasters topo_128 and topo_129 are copied over (as specified in the WHERE clause).

To copy a raster from an ArcSDE geodatabase on one server to an ArcSDE geodatabase on another server, you need to specify both the source file information and the destination location. The raster in the following example is being copied from a geodatabase on the server taciturn and is copied to another geodatabase on the server ultra.

sderaster -o copy -l topo,image -g -u gis1 -n carto_copy "-l carto,raster -u gis2 -p gis -i lands -s taciturn -W name = 'topo_128' or name = 'topo_129'"

Connecting to server ultra, port 7000, as user gis1

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar

Connecting to server taciturn, port 9000, as user gis2

Creating user table: topo
Creating raster layer: topo.image
Raster ID : 1

Total Time: 00:00:02

Complete...

Delete a raster

In this example, one raster with raster ID 295 is being removed from the topo layer.

sderaster -o delete -l topo,image -v 295 -u gis1

Connecting to server ultra, port 7000, as user gis1

Raster ID : 295
Deleted.

Complete...

Describe raster columns

In this example, no specific layer is specified, so all raster columns are described.

sderaster -o describe -u gis1


Connecting to server ultra, port 7000, as user gis1

Raster Layer Description ....: <None>
Table Name ..................: GIS1.TOPO
Raster Column ...............: IMAGE
Raster Layer ID .............: 2
Minimum Raster ID ...........: 1
Creation Date ...............: Wed Jun 13 12:43:35 2001
User Privileges .............: SELECT, INSERT, DELETE, UPDATE
Raster Layer Configuration ..: DEFAULTS
Coordinate System ...........: <None&gbr


Raster Layer Description ....: <None>
Table Name ..................: GIS1.LANDMARKS
Raster Column ...............: IMAGE
Raster Layer ID .............: 3
Minimum Raster ID ...........: 1
Creation Date ...............: Wed Jun 13 14:01:22 2001
User Privileges .............: SELECT, INSERT, DELETE, UPDATE
Raster Layer Configuration ..: DEFAULTS
Coordinate System ...........: <None>

2 raster(s).

Complete...

Here, the topo layer and image column are specified.

sderaster -o describe -l topo,image -u gis1

Connecting to server ultra, port 7000, as user gis1

Raster Layer Description ....: <None>
Table Name ..................: GIS1.TOPO
Raster Column ...............: IMAGE
Raster Layer ID .............: 2
Minimum Raster ID ...........: 1
Creation Date ...............: Tue Jun 12 16:05:47 2001
User Privileges .............: SELECT, INSERT, DELETE, UPDATE
Raster Layer Configuration ..: DEFAULTS
Coordinate System ...........: <None>

Drop a raster layer

In this example, the topo raster layer is dropped.

sderaster -o drop -l topo,image -u gis1

Connecting to server ultra, port 7000, as user gis1

Deleting raster layer topo.image...

Complete...

Export a raster

Below, a raster (ID 821) is being exported from the topo layer to file topo_938.tif.

sderaster -o export -l topo,image -v 821 -f topo_938.tif -u gis1

Connecting to server ultra, port 7000, as user gis1

Exporting...
Raster ID : 821

Total Time: 00:00:00

Complete...

Import an image

In this example, the image topo_562.tif is being converted to a raster layer, topo, which will be accessed from ArcGIS Desktop applications as a raster dataset.

sderaster -o import -l topo,image -c lz77 -g -v 232 -f topo_562.tif -u gis1

Connecting to server ultra, port 7000, as user gis1

Creating user table: topo
Creating raster layer: topo.image

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Raster ID : 1

Total Time: 00:00:02

Complete...

Rasters from other raster layers can be used as the source of the import by specifying the raster in a quoted string after the -f option. For instance, rather than specifying the image file topo_137.tif in the above example, a raster from another geodatabase is used. Note that if you use this method, the -l argument specifying the source ArcSDE raster must immediately follow the double quotation marks. Any other argument or white space results in an invalid raster error.

sderaster -o import -l topo,image -c lz77 -g -v 562 -f "-l carto,raster -v 102 -i lands -s taciturn -u gis2 -p gis" -u gis1

Connecting to server ultra, port 7000, as user gis1

Creating user table: topo
Creating raster layer: topo.image

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Raster ID : 1

Total Time: 00:00:02

Complete...

The import operation can import multiple files into the same raster column. This is done by listing the files at the end of the command and not specifying the -f option.

sderaster -o import -l europe,raster -c jpeg -q 50 -u gis1 france.bsq spain.bsq

france.bsq:
Opening file france.bsq...
Connecting to server jolex, port 9000, as user gis1

Creating user table: europe
Creating raster layer: europe.raster

Image Dimension..............: 238, 134, 3
Pixel Type...................: uchar
Raster ID : 1
Time : 00:00:01

spain.bsq:
Opening file spain.bsq...
Image Dimension..............: 210, 127, 3
Pixel Type...................: uchar
Raster ID : 2
Time : 00:00:00

Total Time: 00:00:02
2 raster(s).

Complete...

In the previous example, the -L option was not specified. That means no pyramids were built on the raster when it was imported. If you later build pyramids on the raster, be sure to specify the same quality (in this example, 50). If you do not, the pyramids will be built with whatever the default quality is for the image type you are using.

Insert images

The insert operation allows you to insert images into a raster layer. Here, one image, topo_0192.tif, is being inserted into the topo layer. The -c option is specifying that LZ77 compression for the data be done as it is inserted into the table.

sderaster -o insert -l topo,image -f topo_0192.tif -c lz77 -u gis1

Connecting to server ultra, port 7000, as user gis1

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Raster ID : 104

Total Time: 00:00:02

Complete...

The insert operation can insert multiple files into the same raster column. This is done by listing the files at the end of the command and not specifying the -f option.

sderaster -o insert -l topo,image -c lz77 -u gis1 topo_0192.tif topo_0193.tif topo_0194.tif

topo_0192.tif:
Opening file topo_0912.tif...
Connecting to server ultra, port 7000, as user gis1

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Raster ID : 104
Time: 00:00:02

topo_0193.tif:
Opening file topo_0913.tif...
Image Dimension..............: 510, 1000, 1
Pixel Type...................: uchar
Raster ID : 105
Time: 00:00:02

topo_0194.tif:
Opening file topo_0914.tif...
Image Dimension..............: 520, 950, 1
Pixel Type...................: uchar
Raster ID : 106
Time: 00:00:02

Total Time: 00:00:07

Complete...

You could also insert multiple files into the same raster column using a wild card. In the example below, all the .tif files in the d:\rasters and f:\bsq directories are being inserted into the orthos file.

sderaster -o insert -l orthos,image -c jp2 -q bitrate=2 -u raster -p raster -i 12000 d:\rasters\*.tif f:\bsq\*.tif

Rasters from other raster layers can be used as the source of the insert by specifying the raster in a quoted string after the -f option. For instance, rather than specifying the image file topo_0192.tif in the above example, a raster from another geodatabase is used.

sderaster -o insert -l topo,image -f "-l carto,rasters -v 102 -u gis2 -p gis -i esri_sde -s taciturn" -c lz77 -u gis1

Connecting to server ultra, port 7000, as user gis1

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Raster ID : 104

Total Time: 00:00:02

Complete...

List information

The list operation returns information about each row in a raster column. This example shows only two rows; your list may be much longer.

sderaster -o list -l topo,image -u gis1

Connecting to server ultra, port 7000, as user gis1

Raster ID ...................: 204
Raster Dimension ............: 500, 1108, 1
Raster Tile Dimension .......: 128, 128
Pixel Type ..................: uchar
Compression .................: none
Image Pyramid ...............: 0, false, none


Raster ID ...................: 205
Raster Dimension ............: 500, 1108, 1
Raster Tile Dimension .......: 128, 128
Pixel Type ..................: uchar
Compression .................: none
Image Pyramid ...............: 0, false, none

Raster ID ...................: 206
Raster Dimension ............: 1001, 2001+24, 1
Raster Tile Dimension .......: 128, 128
Pixel Type ..................: uchar
Compression .................: none
Image Pyramid ...............: 0, false, none

3 raster(s).

Complete...

The raster ID uniquely identifies the raster within the raster column. The raster dimension lists three values: pixel width, pixel height, and number of bands. Depending on how the data was loaded, the pixel width or pixel height may include a pixel offset from the nearest tile boundary. An offset is indicated by a plus sign (+) followed by a value. The value indicates the number of pixels the nearest tile boundary is to the left of the image for the x dimension or the number of pixels the nearest tile boundary is above the image for the y dimension. The offset information is only useful for advanced application developers who need to know where the image begins in relation to the underlying tile structure. The raster tile dimension lists the pixel width and pixel height of a tile. The pixel type lists the bit depth of the pixel data. The pixel types are listed as follows:

The compression is the type of compression the raster was stored in. Possible compression types include

You can specify that the values of a single row are returned by including the -v option.

sderaster -o list -l topo,image -v 205 -u gis1 -storage

Connecting to server ultra, port 7000, as user gis1

Raster ID ...................: 205
Raster Dimension ............: 500, 1108, 1
Raster Tile Dimension .......: 128, 128
Pixel Type ..................: uchar
Compression .................: none
Image Pyramid ...............: 0, false, none

1 raster(s).

Complete...

The -storage option includes additional storage information about each band and pyramid level. The -storage option examines each pixel block record of a raster and, therefore, requires a significant amount of time to process depending on the size of the raster. For each band of each pyramid level, the minimum and maximum tile sizes, as well as the mean size and standard deviation, are provided. Also, the number of records in the raster blocks table is displayed along with storage space occupied by those block table records.

sderaster -o list -u gis1 -l province,raster -v 1 -storage

Connecting to server ultra, port 7000, as user gis1

Raster ID ...................: 1
Raster Dimension ............: 88383, 41428, 1
Raster Tile Dimension .......: 320, 256
Pixel Type ..................: uchar
Compression .................: lz77
Image Pyramid ...............: 8, false, nearest
Raster Tile Storage .........:
min max mean std dev count total
Level 0:
Band 1 103 4889 350.99 514.74 23355 8,005 KB
Level 1:
Band 1 103 5787 524.76 688.27 6256 3,206 KB
Level 2:
Band 1 103 6201 788.03 872.64 1726 1,328 KB
Level 3:
Band 1 103 6695 1178.07 1014.13 475 546 KB
Level 4:
Band 1 103 4859 1650.67 1077.74 134 216 KB
Level 5:
Band 1 208 4268 2042.66 1089.10 41 82 KB
Level 6:
Band 1 222 5358 2223.50 1544.52 14 30 KB
Level 7:
Band 1 268 5568 1945.00 2167.35 6 11 KB
Level 8:
Band 1 359 3978 2168.50 2559.02 2 4 KB
13,430 KB

13,752,096 bytes
 
1 raster(s).
 
Complete...

You can get additional information about the image extent of the raster and the cell size in world coordinates by using the -verbose option. The raster statistics are also displayed with the -verbose option, listing the minimum and maximum values as well as the mean and standard deviation.

sderaster -o list -u gis1 -l province,raster -verbose -v 1

Connecting to server ultra, port 7000, as user gis1

Raster ID ...................: 1
Raster Dimension ............: 88383, 41428, 1
Raster Tile Dimension .......: 320, 256
Pixel Type ..................: uchar
Compression .................: lz77
Image Pyramid ...............: 8, false, nearest
Extent ......................:
minx : -141.00161818181800
miny : 41.68847272727270
maxx : -52.61961818181820
maxy : 83.11547272727270
Cell Size....................:
x : 0.00100000000000
y : 0.00100000000000
Statistics ..................:
min : 1.0000000000
max : 13.0000000000
mean : 6.1075254726
std dev : 3.6373814396
 

1 raster(s).

Complete...

Mosaic

This mosaic operation is integrating topo_137.tif with raster (ID 382) in the topo layer. Remember, the mosaic operation requires raster columns to have a coordinate system, both the existing and new images must have the same cell size and alignment, and the raster cannot have a color map. If the raster already has a color map, you must remove it before you mosaic, then reapply the color map.

sderaster -o mosaic -l topo,image -v 382 -q 50 -f topo_137.tif -u gis1

Connecting to server ultra, port 7000, as user gis1

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Image Extent.................:
minx : 234917.94185799997649
miny : 4198842.21638599969447
maxx : 239987.78185799997300
maxy : 4210089.33638599980623
Raster ID : 382

Total Time: 00:00:04

Complete...

Rasters from other raster layers can be used as the source of the mosaic by specifying the raster in a quoted string with the -l option. For instance, rather than specifying the image file topo_137.tif in the above example, a raster from another geodatabase is used below.

sderaster -o mosiac -l topo,image -v 382 "-l carto,raster -v 102 -i lands -s taciturn -u gis2 -p gis" -u gis1

Connecting to server ultra, port 7000, as user gis1

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Image Extent.................:
minx : 234917.94185799997649
miny : 4198842.21638599969447
maxx : 239987.78185799997300
maxy : 4210089.33638599980623
Raster ID : 382

Total Time: 00:00:04

Complete...

The mosaic operation can mosaic multiple files into the same raster column. This is done by listing the files at the end of the command and not specifying the -l option.

sderaster -o mosiac -l topo,image -v 382 -q 60 -u gis1 france.bsq spain.bsq

Connecting to server ultra, port 7000, as user gis1

france.bsq
Opening file france.bsq...
Image Dimension..............: 238, 134, 3
Pixel Type...................: uchar
Image Extent.................:
minx : -6.24520815168458
miny : 41.23423565568964
maxx : 10.60812558971746
maxy : 50.69201366247066
Time : 00:00:01

spain.bsq:
Opening file spain.bsq...
Image Dimension..............: 210, 127, 3
Pixel Type...................: uchar
Image Extent.................:
minx : -9.65854156766455
miny : 35.26090217772306
maxx : 5.20368101441573
maxy : 44.22090239467350
Time : 00:00:01

Raster ID : 382

Total Time: 00:00:03

Complete...

You could also mosaic multiple files into the same raster column using a wild card. In the following example, all the BSQ files in the specified directory are used.

sderaster -o mosaic -l land,image -v 407 -u editor2 -p change c:\raster_temp\*.bsq

The mosaic operation can also be used with the -m option set to delete to toggle the NoData bitmask. In this example, the image, myraster.tif, is mosaicked with the data layer, and all values of 0 are interpreted as NoData values. This results in the target file (data) having NoData values in the corresponding pixels.

sderaster -o mosaic -m delete -a 0 -l data,raster -s gis_server1 -D gdb1 -u gis2 -p gis.2
-i sde:postgresql:gis_server1 -v 1 -L -1 -I bilinear myraster.tif

Create a pyramid

A pyramid is created on the topo layer with a pyramid level of -1, meaning all the levels required to reach the apex will be created; skipLevel1 is also specified, though, so the first level of the pyramid will not be built.

sderaster -o pyramid -l topo,image -L -1,skipLevel1 -v 701 -q 80 -u gis1

Connecting to server ultra, port 7000, as user gis1

Updating pyramid...
Raster ID : 701

Total Time: 00:00:00

Complete...

Be sure that when you build the pyramids that you specify the same quality value as was used when you imported the raster. If you do not specify the quality, the default value for the compression type of the raster will be used.

Calculate statistics on a raster

Statistics are calculated below on the raster (ID 847).

sderaster -o stats -l topo,image -v 847 -f topo_291.tif -u gis1

Connecting to server ultra, port 7000, as user gis1

Calculating statistics...
min : 27.0000000000
max : 248.0000000000
mean : 99.4931516245
std dev : 55.8325332694


Raster ID : 847

Total Time: 00:00:01

Complete...

The -L option allows you to build image statistics based on a reduced resolution pyramid level. For large rasters, this can provide a fast way to create image statistics for a fractional loss of accuracy. You can direct the sderaster command to build statistics on a particular level by specifying that level with the -L option, or you can enter -1 to specify that the top level of the pyramid should be used to build image statistics.

sderaster -o stats -l topo,image -v 847 -u gis1 -L -1

Connecting to server ultra, port 7000, as user gis1

Calculating statistics...
min : 27.0000000000
max : 248.0000000000
mean : 99.4931516245
std dev : 55.8325332694

Raster ID : 847

Total Time: 00:00:01

Complete...

The -d option allows you to remove the statistics from the raster.

sderaster -o stats -l topo,image -v 847 -u gis1 -d

Connecting to server ultra, port 7000, as user gis1

Statistics & histogram updated.

Complete...

Remove rasters from a layer

If you want to remove the rasters from a layer and reload different rasters, you can use the truncate operation. Here, the truncate operation is used to delete the rasters of a raster layer, topo. The layer's schema, though, is unaffected.

sderaster -o truncate -l topo,image -u gis1


Connecting to server ultra, port 7000, as user test

Truncating raster layer topo.image...

Complete...

Update a raster

Here, the raster (raster ID 495) is being replaced with image topo_982.tif.

sderaster -o update -l topo,image -v 495 -f topo_982.tif -c jp2 -q bitrate=1 -u gis1

Connecting to server ultra, port 7000, as user gis1

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Raster ID : 495

Total Time: 00:00:03

Complete...

Rasters from other raster layers can be used as the source of the update by specifying the raster in a quoted string after the -f option. For instance, rather than specifying the image file topo_982.tif in the above example, a raster from another geodatabase is used.

sderaster -o update -l topo,image -v 495 -f "-l carto,raster -v 102 -i lands -s taciturn -u gis2 -p gis" -c lz77 -u gis1

Connecting to server ultra, port 7000, as user gis1

Image Dimension..............: 500, 1108, 1
Pixel Type...................: uchar
Raster ID : 495

Total Time: 00:00:03

Complete...

 

Home

Copyright © Environmental Systems Research Institute, Inc. 2004 - 2010.