Removing a color representing NoData from an image service definition

It is recommended that you edit the shape of a footprint polygon to remove unwanted pixels from a raster dataset (especially when around the board of the raster dataset). This method of clipping is much more efficient than using transparency to exclude NoData pixels, especially in cases of overlapping raster datasets. To do this, you can use the Recompute Footprint By Radiometry feature. This feature has a set of parameters that let you define the minimum and maximum pixel values that should be considered NoData. Additionally, you can specify other parameters that define the approximate number of vertices required to represent the shape, which can be very effective while extracting the correct footprints, especially when the edges are irregular. One limitation of this feature is that the NoData values can only be defined as either black or white color.

It's easy to define a black or white value in a raster dataset, whether it's an RGB band combination or a single-band image, because the values will always be the same for each band. However, there are raster datasets that use specific colors, such as green, to symbolize a NoData value. In those cases, the pixel values for each band will vary.

In this workflow, you will apply a classification to the raster datasets at the service level to recompute the NoData values from a color into black or white and the remaining values into gray. Next, you will use the Recompute Footprint By Radiometry feature to extract and update the desired footprint. Then you will remove the classification process, leaving you with the correct footprints for your image service definition.

Create an image service definition

手順:
  1. Open ArcMap.
  2. Click the Image Service drop-down menu on the Image Service Definition Editor toolbar, point to Advanced, then click New Service Definition.
  3. Type the Service definition path and name in the text box, or click the browse button to navigate to the location and provide a name.
  4. Click the Spatial reference browse button and choose a spatial reference file for either a geographic or projected coordinate system.
  5. Click the Service type drop-down arrow and click Color (RGB).
  6. Click OK to create the new service.

    The new service is added to the table of contents as a customized group layer.

  7. Click the Image Service drop-down menu on the Image Service Definition Editor toolbar, point to Advanced, then click Add Raster Dataset.
  8. Add your raster dataset to the image service definition.
  9. Click the Image Service drop-down menu on the Image Service Definition Editor toolbar, point to Advanced, then click Build.

    Build the image service definition with the default options.

  10. Click OK.
注意注意:

It is recommended that you generate service overviews after recomputing the footprints.

You should be able to preview after building the image service definition, but in many cases, the NoData values at the edges of the raster datasets hide the data. If the NoData values are black or white, the standard process to recompute footprint by radiometry can be used to redefine the footprints. However, for NoData values with different colors, you will have to use the Classify Pixel process before recomputing the footprints.

Add the Classify Pixel service process

Applying the Classify Pixel process converts the specific colors, such as green, to black.

手順:
  1. Click the Image Service Properties button イメージ サービス プロパティ on the Image Service Definition Editor toolbar.
  2. Click the Service Process node.
  3. Add the Classify Pixel process to the Processes Selected list and click the Edit button Edit Process button to change the required process parameters.
  4. Click the Include method drop-down arrow and click All.
  5. Click the Exclude method drop-down arrow and click And.
  6. Type the appropriate pixel value to represent the color in the Exclude range for band text boxes.

    For example, green is typically represented by the RGB values 0,255,0. Therefore, you could type 0-0 in the Exclude range for band 1, 254-255 in the Exclude range for band 2, and 0-0 in the Exclude range for band 3 fields.

  7. Build the image service definition with the Compute Output Properties option checked.
ヒントヒント:

You could also change the output definition from three bands to one band, because the classification process will change the output to a panchromatic image service definition.

Recompute the footprints by radiometry

手順:
  1. Right-click the Footprint layer in the table of contents, point to Recompute Footprint, then click By Radiometry.
  2. Click the Image type drop-down arrow and click an option.
  3. Click the Image compression drop-down arrow and click either Noncompressed imagery or Lossy compressed imagery.
  4. Optionally, click the Advanced tab and make changes to the parameters.
  5. Click OK.

    The footprints are redefined to the exact extents of the image and unwanted colors are removed.

After running this process, you should be able to see the footprints correctly following the extents of the NoData values, and the areas of NoData should not be visible. If they are still visible, you may have to edit the parameters in the Classify Pixel process.

ヒントヒント:

You could also handle images with alpha channel bands and display alpha channel bands as NoData using the Recompute Footprint By Radiometry option.

Remove the Classify Pixel process

手順:
  1. Click the Image Service Properties button イメージ サービス プロパティ on the Image Service Definition Editor toolbar.
  2. Click the Service Process node.
  3. Remove the Classify Pixel process from the Processes Selected list.

Build and compile the image service definition

As a final step, it is necessary to change the image service definition back to the original three-band service.

手順:
  1. Click the Image Service drop-down menu on the Image Service Definition Editor toolbar, point to Advanced, then click Build.
  2. Check Compute output pixel properties and Load preview.
  3. You may need to build service overviews.
  4. Compile the image service definition.

関連項目


7/10/2012