You are here: Advanced Encoding and Tools > Encoding Areas of Interest > Specifying an Area of Interest

Specifying an Area of Interest

You may specify an area of interest either by defining a rectangle or by using a vector overlay file.

Defining a Rectangle

Area of interest switches are listed and described in a table below. You can define a rectangle in several ways:

To specify edge offsets, use the -aoitop, -aoibottom, -aoileft, and -aoiright switches with floating point values (either pixels or geocoordinates; see “Unit of Measurement” below). For example:

-aoitop 244 –aoibottom 300 –aoileft 16 –aoiright 447 

To specify upper left and lower right values, use the -aoiulxy and -aoilrxy switches with floating point x and y values for each. For example:

-aoiulxy 30 84 –aoilrxy 451 515

To specify upper left, width and height values, use the -aoiulxy and -aoiwh switches.

To specify center, width and height values, use the -aoicxy and -aoiwh switches.

Unit of Measurement

The unit of measurement for areas of interest can be either pixels or geocoordinates. Use the -aoicoord switch to change the measurement unit. Acceptable values: image (pixels) geo (geocoordinates) The default measurement unit for areas of interest is pixels.

Using a Vector Overlay File

GeoExpress supports vector overlay files of Esri shapefile (*.shp), MapInfo (*.tab) and GML (*.xml) formats. To specify a vector overlay use the -aoivectoroverlay or the -aoivo switch with the name of the file. To specify which zero-based layer of a vector overlay file to use for an area of interest operation, use the -aoivectorlayer or the -aoivol switch in. For example:

-aoivectoroverlay seattlesp_utm.shp –aoivol 3

By default, the first layer in the vector overlay file is used.

A Note on GFS Files

The use of GML-formatted vector overlays can result in the creation of files with a “.gfs” extension in the directory on your computer where the GML files are stored. These are not used again and may be ignored or deleted.

The Switches

Several switches are available on the command line for defining and encoding areas of interest. Many are common to both MrSID and JP2. Several are MrSID-only or JP2-only switches.

Common Switches

The table below describes switches common to both MrSID and JP2.

NOTE: The position switches are functionally identical to the corresponding cropping switches.

Common Area of Interest Switches
Switch Value Notes
-aoitop float Specifies area of interest offset from top.
-aoileft float Specifies area of interest offset from left.
-aoibottom float Specifies area of interest offset from bottom.
-aoiright float Specifies area of interest offset from right.
-aoiulxy float0 float1 Specifies upper left XY position of area of interest.
-aoilrxy float0 float1 Specifies lower right XY position of area of interest.
-aoicxy float0 float1 Specifies center XY position of area of interest.
-aoiwh float0 float1 Specifies width and height of area of interest.
-aoicoord string Sets the coordinate system for area of interest to image or geo. Default: image.
-aoimaskinner   Drives the interior area to a single color value (defaults to black). Cannot be used with any other AOI method (-aoicr, -aoilossless, -aoishiftinner, -aoishiftouter, -aoimaskouter, -aoiweightinner, -aoiweightouter).
-aoimaskouter   Drives the exterior area to a single color value (defaults to black). Cannot be used with any other AOI method (-aoicr, -aoilossless, -aoishiftinner, -aoishiftouter, -aoimaskouter, -aoiweightinner, -aoiweightouter).
-aoimaskcolor string

Optional switch used in conjunction with the -aoimaskinner and -aoimaskouter switches to specify the mask color. Acceptable values are:

black – uses the minimum sample value

white – uses the maximum sample value

RRR_GGG_BBB – uses a custom 8-bit RGB color

Default: black.

-aoivectoroverlay string Alternatively -aoivo. Specifies an area of interest using a vector overlay file. Supported vector overlay formats include: Esri shapefile (*.shp) MapInfo (*.tab) GML (*.xml)
-aoivectorlayer sint Alternatively -aoivol. Specifies the zero-based layer within a vector overlay file to use for an area of interest operation. The default layer is the first layer in the file.

MrSID-Only Switches

The table below describes switches available only for MG3 and MG4 formats. For more information see MG3 and MG4 Area of Interest Encoding.

MrSID-Only Area of Interest Switches
Switch Value Notes
-aoicr float Encodes area of interest with a specific compression ratio.
-aoilossless   Encodes area of interest losslessly.

JP2-Only Switches

The table below describes JP2-only switches. For more information see JP2 Area of Interest Encoding.

JP2-Only Area of Interest Switches
Switch Value Notes
-aoinumlevels uint Determines the number of zoom levels that the area of interest encoding applies to. Defaults to all zoom levels.
-aoishift uint Used in conjunction with -aoishiftinner or -aoishiftouter. Sets an optional shift value to be used with either the "shift inner" or "shift outer" area of interest methods.
-aoishiftinner   Preserves quality in the interior area of interest.
-aoishiftouter   Preserves quality in the exterior area of interest.
-aoiweightinner uint Encodes the interior area with a given weight value.
-aoiwieghtouter uint Encodes the exterior area with a given weight value.