Supported with:
ArcGIS Engine with 3D or Spatial extension,
ArcGIS Desktop with 3D or Spatial Analyst,
ArcGIS Server with 3D or Spatial extension
Library dependencies:
System,
SystemUI,
Geometry,
Display,
Server,
Output,
GeoDatabase,
GISClient,
DataSourcesFile,
DataSourcesGDB,
DataSourcesOleDB,
DataSourcesRaster,
GeoDatabaseDistributed,
Carto,
Location,
Controls
The GeoAnalyst library is a shared object library available to users who have an ArcGIS 3D or a Spatial extension license. It provides an easy to customize environment and includes a rich set of tools for application development. As a shared library, it builds upon the raster-related objects of the DataSourcesRaster library by providing objects that are used to access, analyze, manage, convert, and visualize raster data.
Note: The SpatialAnalyst library also includes objects used to process raster datasets; however, those are available only to users who have an ArcGIS Spatial extension license. As noted above, objects in the GeoAnalyst library can utilize either an ArcGIS 3D or Spatial extension license.
As a shared library, GeoAnalyst also includes features that compliment the SpatialAnalyst library such as unified data access and interaction independent format, a high level non-proprietary language.
To increase system performance, raster outputs from some methods, such as Slope, are not computed until they are used. This deferred evaluation of output datasets can result in outputs never being calculated if they are never used. Any use of the output, including creating a layer, examining the height and width of the output, or making the dataset permanent, will trigger evaluation of the expression to create the dataset.
There are many objects in the GeoAnalyst object model and hundreds of methods to perform spatial modeling. Even though there are many objects and methods, there are five main steps when implementing any GeoAnalyst operation. They are:
- Obtaining a Spatial Analyst or a 3D Analyst license
- Setting the analysis environment
- Accessing the input data
- Performing an operation
- Using the output
For a detailed accounting of these steps and other related information, see the 'Working with ArcGIS Spatial Analyst objects' article.
Running concurrent Spatial operations
SpatialAnalyst and GeoAnalyst objects are not threadsafe at 9.0. Running concurrent spatial operations using the same
workspace may crash the application. The workaround is to use separate output workspaces for each process or application. However, the SpatialAnalyst and GeoAnalyst objects are threadsafe at 9.2
RasterAnalysis coclass
The analysis environment (through the
RasterAnalysis object) controls a number of primary properties when performing analysis, the cell size, extent, mask, spatial reference and workspace. Even though these settings do nothing to the original data, the extent and mask do affect the locations where the operation will occur. The extent defines the area on which the operation will be performed. The mask defines the cell locations within the extent on which to perform the operation. And, the specified cell size controls the resolution of the output. When first created, the new operator object obtains its parameters from the settings in the RasterAnalysis object. Each operator object may have its own analysis environment settings. One can set the environment parameters individually for each operator object. The following function demonstrates how to change the default analysis environment settings that subsequent newly created operator objects will inherit. The analysis environment be altered and then set back to the default setting again.
[Visual Basic 6.0]
Public Function SetNewDefaultEnvironment(pExtent As IEnvelope, nCellSize As Double, _
pMask As IGeoDataset, pWS As IWorkspace, pPrj As ISpatialReference) _
As IRasterAnalysisEnvironment
' Creates new RasterAnalysis object and sets it as a new default settings
On Error GoTo ERH
' Create a RasterAnalysis object
Dim pEnv As IRasterAnalysisEnvironment
Set pEnv = New RasterAnalysis
' Set the new default extent
If Not pExtent Is Nothing Then pEnv.SetExtent esriRasterEnvValue, pExtent
' Set the new default cellsize
If nCellSize > 0 Then pEnv.SetCellSize esriRasterEnvValue, nCellSize
' Set the new default mask for analysis
If Not pMask Is Nothing Then Set pEnv.Mask = pMask
' Set the new default output workspace
If Not pWS Is Nothing Then Set pEnv.OutWorkspace = pWS
' Set the new default output spatial reference
If Not pPrj Is Nothing Then Set pEnv.OutSpatialReference = pPrj
' Set it as the default settings
pEnv.SetAsNewDefaultEnvironment
' Return reference to the default environment setting
Set SetNewDefaultEnvironment = pEnv
Exit Function
ERH:
Set SetNewDefaultEnvironment = Nothing
End Function
RasterDescriptor coclass
The
RasterDescriptor object provides access to members that control the raster descriptor. It provides a way of using a field other than "value" field in the raster table to perform queries. It also allows one to perform a query, using a where clause, and then use this subset to perform the analysis. A selection set can also be created for use in further analysis. RasterDescriptor can be used in the RasterReclassOp for example.
FeatureClassDescriptor coclass
Provides access to members that control the
FeatureClass descriptor and provides a way of using values of a specified field or fields. It can be used with the members of IInterpolationOp and
IDistanceOp, for example.
RasterConversionOp coclass
The
RasterConversionOp provides a means to convert between raster and feature data. The different interfaces have the conversion operations grouped according to similar processes.
The RasterToLineFeatureData, RasterToPointFeatureData, and RasterToPolygonFeatureData methods convert raster data to line, point, and polygon feature data respectively.
The ToFeatureData method, on the other hand, allows one to convert raster data to feature data (FeatureClass or FeatureDataset) where the user specifies the geometry. The ToRasterDataset method converts feature data to a raster format.
The ExportToASCII and ExportToFloat methods convert raster data sets to a flat file of ASCII and binary floating-point files respectively. The ImportFromASCII and ImportFromFloat methods import data from these flat files and create new rasters. The ImportFromUSGSDEM method in the IRasterImportOp interface converts a DEM in USGS format to a raster and the method in the IRasterImportOp2 interface has an additional parameter specify the number of ground x, y units in one surface z unit.
Interface(s) IConversionOp, IRasterAnalysisEnvironment, IRasterExportOp, IRasterImportOp, IRasterImportOp2
Method(s) RasterToLineFeatureData, RasterToPointFeatureData, RasterToPolygonFeatureData, ToFeatureData, ToRasterDataset, ExportToASCII, ExportToFloat, ImportFromASCII, ImportFromFloat, ImportFromUSGSDEM, ImportFromUSGSDEM (in IRasterImportOp2 interface)
RasterTransformationOp coclass
The
RasterTransformationOp object provides a mechanism to transform raster data. The
ITransformationOp interface provides access to a host of methods to transform the dataset.
The Clip method is used to cut out a rectangular portion of a raster and the Flip method flips the raster along the horizontal axis. The Mirror method mirrors the raster along the vertical axis. The Rotate method rotates a raster around the specified pivot point by an angle specified in degrees.
The Mosaic method creates one raster from multiple input rasters using a user selectable method to deal with overlapping areas of the neighboring rasters.
The ProjectFast method allows one to project a raster to a new spatial reference using the esriGeoAnalysisResampleEnum enumerator which allow on to pick a nearest, bilinear or cubic resampling technique. The Warp method allows one to transform or rubber sheet a raster along a set of links using a polynomial transformation.
The Resample method resamples a raster to a new cell size. The Rescale method scales a raster by the specified x and y scale factors.
The Shift method allows one to shift a raster in the x and y direction by specifying the respective distances.
Interface(s) ITransformationOp, IGeoAnalysisEnvironment, IRasterAnalysisEnvironment, ISupportErrorInfo
Method(s) Clip, Flip, Mirror, Mosaic, ProjectFast, Resample, Rescale, Rotate, Shift, Warp
RasterMakerOp coclass
The
RasterMakerOp objects can be used to create new raster datasets. The IRasterMakerOp interface supports three methods for creating new datasets that are available on the IRasterMakerOp interface. The
MakeConstant method allows one to create a dataset that consists of a single integer or floating point value. The
MakeNormal method creates a raster of random values from a normal distribution with a mean of 0 and a standard deviation of 1. The
MakeRandom method creates a raster that consists of random numbers between 0 and 1 with the choice of specifying an optional seed value.
Interface(s) IRasterMakerOp, IGeoAnalysisEnvironment, IRasterAnalysisEnvironment
Method(s) MakeConstant, MakeNormal, MakeRandom
RasterMathSupportOp coclass
The
RasterMathSupportOp object provides a few basic operations and is shared between ArcGIS Spatial Analyst and 3D Analyst. For example,
RasterMathSupportOp can be used for changing Z units of an elevation raster in the 3D Analyst environment. The
RasterMathOps interface, however, has the complete list of methods available to users of ArcGIS Spatial Analyst.
Interface(s) IMathSupportOp, IGeoAnalysisEnvironment, IRasterAnalysisEnvironment
Method(s) Divide, Float, Int, Minus, Plus, Times
NumberRemap coclass
The
NumberRemap object can assist in operations involving the reclassification of numerical data. A single value can be mapped onto a range and visa versa and also a range can be remapped onto another range by using the methods on the
INumberRemap interface. The NumberRemap object can be useful for classifications, which can then lead to vectorization and subsequent vector based, overlay analysis. The
IRemap interface allows one access into the ReclassByRemap interface on the
RasterReclassOp object, for example.
Interface(s) INumberRemap, IRemap
Method(s) LoadNumbersFromASCIIFile, LoadNumbersFromTable, MapRange, MapRangeToNoData, MapValue, QueryRecordNumber, QueryNumberValue
StringRemap coclass
The
StringRemap object allows one to perform operations that control the reclassification of string data. The StringRemap object can be used, for example, in a suitability study to assign weights to a raster. The IRemap interface allows one access into the
ReclassByRemap interface on the RasterReclassOp object, for example.
Interface(s) IStringRemap, IRemap
Method(s) LoadStringFromTable, MapString, MapStringToNoData, QueryStringRecord, QueryStringValue, Clear, DeleteRecord, HasValueToNoData, QueryNoData, QueryRecord, RepresentAsTable, SaveAsTable
RasterReclassOp coclass
The
RasterReclassOp object is used to perform the
Reclass Operation. RasterReclassOp can also be useful for classification, which can then lead to vectorization and subsequent vector based, overlay analysis. The
Lookup method creates a new raster by looking up values found in another field in the table of the input raster. The Reclass method reclassifies (or changes) the values in a raster. The
ReclassByASCIIFile method reclassifies (or changes) the value of the input cells of a raster by using an ASCII remap file. The
ReclassByRemap method reclassifies (or changes) the values of the input cells of a raster by using a remap that is built programmatically in the
IRemap interface on the
NumberRemap or
StringRemap objects, for example. The
Slice method slices (or changes) a range of values of the input cells by using the enumerators listed in
esriGeoAnalysisSliceEnum which allow one to choose between an equal area or an equal interval method.
Interface(s) IReclassOp, IGeoAnalysisEnvironment, IRasterAnalysisEnvironment
Method(s) Lookup, Reclass, ReclassByASCIIFile, ReclassByRemap, Slice
RasterRadius coclass
The
RasterRadius object defines a mechanism to control the radius used to determine a surface, for example, through interpolation. It is primarily used to define the number of points via a fixed or variable radius. It can, for example, be used in the
IDW method on the
RasterInterpolationOp to specify either fixed or variable number of points to consider when estimating a value at a location.
Interface(s) IRasterRadius
Method(s) SetFixed, SetVariable
RasterNeighborhood coclass
Focal functions, for example, compute an output raster where the output value at each location is a function of the input cell(s) in some specified neighborhood of the location. The
IRasterNeighborhood interface contains the methods that provide the different neighborhood options. The
SetAnnulus method provides a means for defining the region lying between two concentric circles to be used as a neighborhood. The
SetDefault method creates a 3 by 3 neighborhood. The
SetIrregular method sets a neighborhood object each of whose entries can be turned either on or off. The
SetWeight method sets a neighborhood object each of whose entries can be assigned a weight. It can be used in the
PointDensity method associated with the
RasterNeighborhood object.
Interface(s) IRasterNeighborhood
Method(s) SetAnnulus, SetCircle, SetDefault, SetIrregular, SetRectangle, SetWedge, SetWeight
RasterInterpolationOp coclass
The
IInterpolationOp interface allows one to access the following methods. The
IDW method performs an inverse distance weighted interpolation on a point feature data set. The
Krige method interpolates a surface from a set of points using kriging. The
Spline method interpolates a surface from a set of points using a minimum curvature spline technique. The
Trend method performs a trend interpolation on a point data set. The
Variogram method is similar to the
Krige method except for the fact that it allows one to specify additional kriging parameters pertaining to the semivariogram. This is done through the
GeoAnalysisSemiVariogram coclass.
The IInterpolationOp2 interface allows access to two more interpolation methods. The NaturalNeighbor method creates a surface from points using a natural neighbor interpolation technique. The TopoToRasterByFile method allows one to generate a hydrologically correct raster of elevation values from point, line, and polygon datasets. The IRasterRadius interface on the RasterRadius object is used to define how the points, to be used in the interpolation method, are to be selected.
The IInterpolationOp3 interface introduces TrendWithRms to output the goodness of fit statistics of the Trend surface to a text file.
Interface(s) IInterpolationOp, IGeoAnalysisEnvironment, IRasterAnalysisEnvironment, IInterpolationOp2
Method(s) IDW, Krige, Spline, Trend, Variogram, NaturalNeighbor, TopoToRasterByFile
GeoAnalysisSemiVariogram coclass
The
GeoAnalysisSemiVariogram object is a mechanism to create a semivariogram object that can be used in the Variogram method that is contained in the
IInterpolationOp interface. The
DefineVariogram method is used to initialize the semivariogram parameters.
Interface(s) IGeoAnalysisSemiVariogram
Method(s) DefineVariogram
RasterConvertHelper coclass
The
RasterConvertHelper objects are included to assist when converting geodatasets to rasters or feature classes. These methods do not require you to specify the workspace nor the name and is useful for operations where temporary output is required.
Interface(s) IRasterConvertHelper
Method(s) ToRaster1, ToRaster2, ToRaster3, ToShapefile
RasterSurfaceOp coclass
The
RasterSurfaceOp object contains a suite of methods that control the generation of a raster surface. The
Aspect method identifies the direction of maximum rate of change in z value from each cell. The
Contour method creates contours or isolines from a raster surface. The
ContourAsPolyline(s) method creates a contour(s) or isoline(s) that passes through a specified point(s) on a surface. The
ContourList method creates contours or isolines based on a list of contour values. The
Slope method identifies the rate of maximum change in z value from each cell. The
Curvature method calculates the curvature of a surface at each cell center. From an applied viewpoint, output of the
Curvature method can be used to describe the physical characteristics of a drainage basin in an effort to understand erosion and runoff processes. The
Slope affects the overall rate of movement downslope and the
Aspect method defines the direction of flow. The profile curvature affects the acceleration and deceleration of flow, and therefore influences erosion and deposition. The planform curvature influences convergence and divergence of flow. The
CutFill method creates output with volume information describing surface changes after a cut-and-fill operation. The
HillShade method creates a shaded relief raster from a raster by considering the illumination angle and shadows. The
Visibility method performs visibility analysis on a raster by determining how many observation points can be seen from each cell location of the input raster, or which cell locations can be seen by each observation point. The
Visibility method on the
ISurfaceOp2 interface has two additional parameters, viz., the number of ground x, y units in one surface Z unit, and a coefficient of the refraction of visible light in air.
Interface(s) ISurfaceOp, IGeoAnalysisEnvironment, IRasterAnalysisEnvironment, ISurfaceOp2
Method(s) Aspect, Contour, ContourAsPolyline, ContourList, ContoursAsPolylines, Curvature, CutFill, HillShade, Slope, Visibility
RasterModel coclass
The
RasterModel object is used to perform raster analysis using map algebra expressions and may include non-raster input/output formats (feature data, tables, etc). It also allows multiple lines of GRID syntax to be used.
Interface(s) IRasterModel, IGeoAnalysisEnvironment, IRasterAnalysisEnvironment
Method(s) BindFeatureClass, BindRaster, BindString, BindTable, Execute, UnbindSymbol
[Visual Basic 6.0]
GridTableOp coclass
The
GridTableOp object is used to perform operations on the
Table object associated with a GRID dataset. The
IGridTableOp interface offers one a way to add a
Field to the dataset or to delete a
Field from the dataset. A
Field can also be updated based on some query filter. The
AddField method is used to add a
Field object to the dataset and the
DeleteField method is used to delete a
Field object from the dataset.
Interface(s) IGridTableOp, IGeoAnalysisEnvironment, IRasterAnalysisEnvironment
Method(s) AddField, DeleteField, Update
Enabling the Spatial Analyst license
In order to access the ArcGIS GeoAnalyst objects one must obtain a Spatial Analyst license or a 3D Analyst license. One can call for a license prior to accessing each GeoAnalyst object, call it once in a single subroutine, or call once globally in the Main routine in a program. Since one only needs to call the single subroutine once, or the license is automatically enabled if one calls it globally, either of these two approaches are the preferred methods for obtaining a license.
[Visual Basic 6.0]
Public Function CheckOutSpatialAnalystLicense() As Boolean
Dim m_pExtmanager As IExtensionManagerAdmin
Set m_pExtmanager = New ExtensionManager
Dim objid As New esriSystem.UID
objid = "esriGeoAnalyst.SAExtension.1"
Dim v As Variant
m_pExtmanager.AddExtension objid, v
Dim pEM As IExtensionManager
Set pEM = m_pExtmanager
Dim pEC As IExtensionConfig
Set pEC = pEM.FindExtension(objid)
pEC.State = esriESEnabled
CheckOutSpatialAnalystLicense = (pEC.State = esriESEnabled)
End Function