Mission

1.    Convert ArcSDM extension for ESRI ArcView 3.3 to ArcSDM2 for ESRI ArcGIS 8/9 by maintaining the original look-and-feel.  The ArcSDM pull-down menu will contain the same commands, and all forms displayed would be identical to ArcView dialogs.

2.    The calculation logic remain2 the same by translating Avenue code line-by-line to Visual Basic code by calls to ESRI ArcObjects.  This will allow the massive conversion project of over 800 avenue scripts and over 40 dialogs to proceed rapidly without having to develop new program logic.

 

Achievement

 

ArcSDM extension for Arcview 3.3 originally coded in the Avenue programming language was converted to ArcSDM2 and ArcSDM3 for ArcGIS8.3 and ArcGIS9, respectively, and coded in Visual Basic COM objects calling ESRI ArcObjects and Spatial Analyst objects.

 

The new ArcSDM toolbar for ArcMAP was coded in VB and compiled into eleven ActiveX DLLS which are deployed as the ArcGIS8.x and ArcGIS9 toolbar called ArcSDM2 and ArcSDM3, respectively. The DLLs are compiled in the following order based on dependencies.  All are dependent on the first two (1, 2), and the last (11) is dependent on all the others.

 

1.    SDMUtilities

2.    AnalysisParameters

3.    WtsOfEvidence

4.    CreateChart

5.    GeneralizeEvidence

6.    SDMAccessories

7.    Calculate_Neural_Network

8.    SDMFuzzification

9.    CalculateLogistRegr

10. CalculateResponse

11. SDMExtension

 

The ArcSDM2/3 toolbar menu items are commands that invoke a VB form from which a single ArcSDM command is run.

 

Convert an Avenue script and generating DLLs

 

All of the Avenue scripts called by the main dialog of an ArcSDM command were converted to text by an ArcView project, sdmparse.apr.  Each converted script was inserted into a standard VB class template (…\VBScripts\ZClassTemplate.txt) to create a COM class.  The original text was then commented. One or more new lines of text in VB code were inserted for each manual translation of a line of original Avenue code. The new code calls an ArcObject where necessary to process ArcGIS layers and datasets.  In addition, error handlers were inserted and line numbering was done.

Conversion Utilities

 

Each ArcView dialog was parsed by an ArcView project, gdialogs.apr, to determine its controls and its called scripts.  This generates a file called CallingTree.txt that is input for program CallingTree.

 

A Java program called CallingTree shows the scripts and their calling order for each dialog invoked by ArcSDM.  This program will also convert an Avenue script to text for insertion into a VB class code.  Use of the CallingTree program promotes a more straightforward conversion of scripts.

 

ArcSDM Dialogs

 

Each ArcSDM dialog was parsed by an ArcView project, dialogctls.apr, to determine its controls and their attributes.  This information is used to generate a nearly similar looking VB form.  Such a conversion program is available on the Internet and is included in this distribution (DialogConverter2.zip).  However, such an Avenue program is easy to create, and the one mentioned here generates code specialized for ArcSDM forms.

 

Each form has its KeyPreview attribute set to TRUE (in its Initialize method), so that a CTRL-SHIFT combination with a command button CLICK will display, where appropriately coded, an ArcSDM Help item.  This is facilitated by a ShiftDown attribute and Form_KeyDown and Form_KeyUp event code.

 

Each form has a special ArcSDM event handler that listens for actions on the various controls on the form.  This event handler is implemented by the SDMListener class in the SDMUtilities.dll and permits enabling and updating controls dependent on the state of other controls.  This implementation parallels Avenue event handling and facilitates conversion of ArcSDM’s Avenue dialog events.  In addition, some forms implement Map and Document events of ArcMap.  This is primarily so that combobox controls on them can be updated for changes in the ArcMap Table of Contents.

 

Caveats

·         Spatial Analyst extension is required.  No other ArcGIS extension is required.

 

·         Internet Explorer browser is required to display help messages.  ArcSDM Help is implemented in the gSDI_Help class.

 

·         No other programs are required such as Excel and Access.

 

·         Due to limitations in ArcObjects and Spatial Analyst in ArcGIS8.x & ArcGIS9, some capabilities of ArcMap are not available to be implemented (i.e., programmed) in VB COM programs by the ArcObjects developer.

 

1.    Fields cannot be added programmatically to raster tables. To overcome this limitation, ArcSDM generates standalone tables with the needed attributes and joins them to evidence and response layers.

 

2.    Raster layers cannot be symbolized programmatically on an attribute of a joined table.  ArcSDM does not perform such symbolizations and leaves this action to the ArcMap/ArcSDM user.

 

 

3.    Spatial Analyst and ArcObjects do not have a method similar to the CellValue method of the GRID object in Avenue.  The workaround in ArcSDM is implemented in the new IRasterBuffer class that has a CellValue method.  Because the new class cannot take advantage projection-on-the-fly, all evidence and training layers must have the same projections in an ArcMap document.

 

4.    The raster analysis environment of Spatial Analyst (Spatial Analyst/Options of ArcMap) applies only to the commands of Spatial Analyst.  It is not exposed for ArcGIS customizations, extensions, & tools.  It also does not apply to geoprocessing tools in the ArcGIS Toolbox.  ArcSDM maintains its own raster analysis environment (RAE) and is set from the study area raster. The ArcSDM RAE extent is the study area extent, the RAE cell size is the study area cell size, and the RAE mask is the study area raster.

 

 

5.    ArcSDM Coordinate System. The DataFrame (Map) for the current ArcSDM model must be set to the coordinate system of the selected study area raster.  If the coordinate system of the DataFrame is Unknown, IRasterbuffer class methods and training point selections will not work as expected.