Knowledge Base



GeoExpress - Knowledge Base Articles

A060602 - Workaround for cropping with polygons

Products:

GeoExpress 6.1 and earlier

Summary:

You would like to use polygon shape files to crop in GeoExpress.

Cause:

Technically speaking, it is not possible to crop a MrSID (.sid) file to a polygon. MrSID files encompass their full extents on the x and y axes. Non-rectangular shape files would introduce areas that have no data within x and y extents of the image.

For example, a polygon that angles up and to the right would have data in the high x and high y area, but no data in the high x and low y area, outside the polygon.

Currently, MrSID files do not have true “no-data” pixel values; each pixel inside the full x and y extents of a MrSID image must have a color assignment (a value from 0 to 255). Thus you can only truly crop MrSID images to rectangular shapes.

Solution:

Combining rectangular cropping and area of interest masking, you can achieve the effect of cropping to polygons. (Further details for the following steps are available in the GeoExpress Help documentation.)

  1. Using the rectangular cropping tool, crop the image to a rectangle covering just the area with which you would like to work. All data outside the rectangle will be discarded.
  2. In the Area of Interest dialog box, specify a vector overlay file.
  3. Choose Mask Outer as the encoding method.
  4. Encode losslessly to preserve precise pixel values (lossy compression generates random pixel colors in the mask, defeating the workaround).

Image data outside of the area of interest polygon but within the crop rectangle will be a uniform color. That color can easily be made transparent when mosaicking in GeoExpress or other programs that offer transparency features.

Status:

GeoExpress 7 added support for cropping with polygons.

This article was last updated or verified on 30 July 2013.