Use a stretch renderer to enhance the visual contrast of raster data for analysis.
Use case
An appropriate stretch renderer can enhance the contrast of raster imagery, allowing the user to control how their data is displayed for efficient imagery analysis.
How to use the sample
Tap the toolbar button to change any of the following properties:
- Stretch type - a histogram stretch that will be applied to the raster to enhance its appearance.
- Min value - the minimum value on the histogram.
- Max value - the maximum value on the histogram.
How it works
- Create an
AGSRaster
from a raster file. - Create an
AGSRasterLayer
from theAGSRaster
. - Add the layer to the map.
- Create an
AGSStretchRenderer
, specifying theAGSStretchParameters
and other properties. - Apply the
AGSStretchRenderer
to the raster layer.
Relevant API
- AGSColorRamp
- AGSMinMaxStretchParameters
- AGSPercentClipStretchParameters
- AGSRaster
- AGSRasterLayer
- AGSStandardDeviationStretchParameters
- AGSStretchParameters
- AGSStretchRenderer
Offline data
This sample uses a raster file. It is downloaded from ArcGIS Online automatically.
About the data
The raster used in this sample shows an area in the south of the Shasta-Trinity National Forest, California.
Additional information
See Stretch function in the ArcMap documentation for more information about the types of stretches that can be performed.
Tags
analysis, deviation, histogram, imagery, interpretation, min-max, percent clip, pixel, raster, stretch, symbology, visualization
Sample Code
//
// Copyright 2016 Esri.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import UIKit
class StretchRendererInputCell: UITableViewCell {
@IBOutlet var textField: UITextField!
}