ArcView Extensions - Beyond the Basics

Written by George Lienkaemper
February 10, 1998


Since the Avenue programming language is open and available to anyone who wants to take the time to learn it, the large pool of talented ArcView users has spawned a number of innovative software developers. One method of adding tools to the ArcView program is through the development of ArcView Extensions. Extensions developed by ESRI are either included among the sample scripts or licensed and sold - like Spatial Analyst. Other extensions developed by the user community are available for sale or free of charge over the Internet. Today we will make use of both commercial and free extensions. All of them will definitely make ArcView a more useful tool.

Log in as the user workshop and use the password work0shop. Move to the directory named for the workstation you're using- at picea cd /data/gisinfo/piceabase; at myrica cd /data/gisifo/myricabase, etc. Start ArcView with av3.
 


XTOOLS

  1. With the project window active, select Extensions under the File menu. Check the boxes next to Xtools.
  2. Open a New View and Add Themes from the arc/info coverages of the Tidbits Creek basin: roads, streams, wsbound, wnfveg, and elevation. (Note the warning that the view units have been set to feet. Go into View Properties and change the map units to meters.)
  3. Make all the themes active (use Shift-Select). Under the Xtools menu choose Batch Import Active Themes to Shapefiles. (Ignore the instruction to enter the path to the directory where you want to save the shapefile. You should space through the default value. If you want to change the name of the new shapefile theme, you can do it under Theme-Properties.)
  4. Make sure the original themes are still active and Delete or Cut Themes under the Edit menu.
  5. The tools in the Xtools extension operate on shapefiles. As you may have noticed when you did the batch import, Xtools offers many overlay functions that we're used to using in Arc/Info, but have not had available in ArcView. Note also that the author of Xtools, made things specific to the jobs and systems associated with his work environment - thus map units in feet and DOS pathnames. These are minor inconveniences considering the power of the tools he developed.


Clipping

This is the function most of us first miss in ArcView. For our example today use Xtools to clip Vegetation (wnfveg) with the Watershed Boundary (wsbound). One point to keep in mind: my experience has been that clipping line themes is a very lengthy process.
Identity Most often we use identity to associate polygon attributes with point or line data. Try an identity of roads with vegetation size_class. Use the Identify tool to verify that the roads in the product picked up the size class attribute. Buffer Prepare a new theme that is a 100-meter buffer zone around the stream network. Intersect
  1. Add a shapefile to your project: /data/garnet/garnetbase/aspect.shp. In the legend editor Load /data/garnet/garnetbase/aspect.avl to create an aspect legend.
  2. In this example Intersect slopes with a south or southwest aspect with elevations between 500 and 1300 meters (range-codes 6 to 13) to determine the areas of highest snowmelt potential in the basin. (This will first require using the Query Builder to create new shapefiles.)

  3.  
Union
    Another approach to the above exercise would be to Union Aspect and Elevation and then use the Query Builder to create a new theme that matches the selection criteria. Try it!
Other Xtools
    When shapefiles are clipped, attributes such as area or length are not automatically updated like coverages in arc/info (which have topology). Use Update Area ...... to accomplish this. There are other tools which update or erase specific areas, much like the same functions in arc/info. Merge allows you to combine like datasets into a single shapefile theme - adjacent quads, for instance. Other tools deal with data created in arcview - polylines or graphics.
Managing Shapefiles
    Shapefiles actually consist of three files - .shp, .shx and .dbf. When a shapefile is deleted from a view these files remain in your directory. Managing them requires operations on all three files at the system prompt. The Manage Shapefiles Xtool provides the means to Copy, Delete, and Rename shapefiles from within ArcView.


PROJECTOR!

ArcView has always had the capability to display themes from geographic coordinates (Longitude and Latitude expressed in decimal degrees) into many different projections. This is a temporary method of display and the data are not actually transformed. There has been no tool to actually reproject themes between projections. The Projector! Extension adds this capability. Now themes in Albers or Lambert can be projected into new shapefiles in UTM or State Plane. This extension operates on shapefiles. (Note: the default spheroid is GRS1980, the basis for the datum NAD83. If your data need the datum NAD27, you should select a custom projection and choose the Clarke1866 spheroid.)

  1. Activate the project window and choose Projector! From the File-Extension menu. Note the new button (an arrow pointing up) on the View GUI.

  2. Open a New View and Add the themes orcnty_lam and hiway_100 from the directory /data/gisinfo/oregon. These themes are in a Lambert projection with these parameters.


  3. Open another New View and Add the theme cities.shp from your workspace. This theme is projected into UTM zone 10. Set the Map Units to meters in the View-Properties menu.
  4. To project the cities.shp into Lambert to display it with your other themes, run the Projector! extension by clicking on the Projector! icon. Place the new shapefile into the View containing county lines and highways.



Other Extensions

You may have noticed other extensions listed under the File-Extensions menu. These tools facilitate the addition of several data types to views - autocad .dxf files, jpeg files, and Imagine .img files; or extend the analytical capability of the software - spatial analyst, network analyst and hydrology tools; or add some features to map layout - Maptools. These extensions reside in the $AVHOME/ext directory. However, you can run extensions that reside in your $HOME directory without having them installed in $AVHOME. Simply copy the <extension.avx file into your home directory; arcview looks there for extensions. Here are a few other extensions that can be found in $AVHOME/arcview3/samples/ext:
 

avlabel

Title: ArcView Labeling Extension

Topics: Graphics, Views

Description: This extension adds two tool menus to View GUIs, and one tool menu to Layout GUIs. These tools allow you to label individual features with labels that contain additional graphics like leaders, backgrounds, shadows or both. The icons for each tool indicate approximately what the result will be. For View GUIs, there are two toolsbars, the first is for adding text that you must enter in the Text Properties window. The second toolmenu contains tools that will label the feature of the active theme(s) that you click on. For the tools that create leaders, click on the feature you want to label and drag in the direction you want the label to appear.

For a complete description of what each tool does, open an new script editor and use the load system script button to put the script into your script editor. All the scripts in this extension begin with the avlabel.xxxxxx prefix.

Requires: A View and Layout DocGUIs that contain a tool bar.
 
 

last4

Title: Remember Saved Projects

Topics: Projects

Description: This extension provides the "last saved" functionality common on windows applications. It maintains a list of the last four projects saved and allows you to go back to them simply by clicking on the appropriate choice in the Project's File menu.

This extension modifies the system scripts Project.Save, Project.SaveAs, Project.Open and Project.NewPart2. If your project or user default project also modifies any of these scripts, the extension will NOT work properly. The extension saves the last projects to an odb file in your $HOME directory called default.l4.

You might want to make this extension part of your default environment. When you load this extension, hit the Make Default button in the extension dialog.

Requires: A project DocGUI named "Project".
 
 

overview

Title: Overview

Topic: Views

Description: The Overview extension adds two new choices to the View menu of selected View DocGUIs. These choices allow you to
create and control an overview views. The Overview view is a small view that displays the full extent of the current view and a rectangle outlining
its extent. When you change the display extent of the current view, the graphic on the overview view changes with it. If you select the overview view, you can modify the rectangle to change the display extent of the current view.  Whenever you close a view with an associated overview, the overview closes. When you open a view with an associated overview, the overview opens. If your overview gets closed or lost among many other documents, you can restore it to the top by using the Display Overview choice in the View DocGUI's View menu.  The overview view has a much simplified user interface. It provides controls to change the extent rectangle and also to delete unwanted themes from the view.

Requires: This requires at least one View DocGUI with a menu named View.
 
 

portprj

Title: Port Project Utility

Topics: Projects

Description: This extension provides utilities that make it easier to move projects from machine to machine. It installs a menu called Port to the project's DocGUI. This menu has two choices "Replace paths" and "Open projects". Replace paths substitutes environment variables for paths names. First, you select a project file. Then the utility finds all the paths referenced in that project file and their subpaths. You pick the file names that you want to substitute with environment variables. Next, it creates a new version of the project with the revised pathnames and it also creates an ODB file with the paths and associated environment variables. The odb file is named like the new project file with a .env extension. When you open a project with the Project open option, if that project was created by the Replace paths option described above, you are given an opportunity to review and revise the required environment variables. If any environment variables reference non-existent directories, you will be prompted to correct the value. The utility then saves any revisions to the .env file for the next time. If you open a project that has not been created by the Replace paths option, then the extension asks you to identify any associated environment variables andtheir paths. Hit cancel when you have specified all environment variables. It establishes the environment variables and creates an associated .env file.

Requires: Requires a project DocGUI named Project.
 
 

seesmpl

Title: Samples Browser

Topics: Scripts, Misc

Description: This extension allows you to peruse, load and unload extensions in the Samples directory. It installs a choice in the Project's File menu that sets the environment variable $USEREXT to $AVHOME/samples/ext, brings up the Extension dialog and then restores $USEREXT. Use this choice to check out sample extensions and load/unload them to your system.

The extension also adds a choice to the Script menu in the Script DocGUI that allows you to load sample scripts to script editors. The saved names are restored.

Copy this extension from the samples directory to your default $USEREXT directory to simplify access to other sample extensions

Requires: A standard ArcView install so that the samples are in the directory $AVHOME/samples/ext.
 
 

vistools

Title: Visibility tools Extension

Topics: Spatial Analyst

Description: This extension adds two tools to View GUIs. This extension requires the Spatial Analyst be loaded. These tools allow you to generate a profile / line-of-sight diagram and a visibility surface. The profile tool allows you to enter a 2 point line, once you've entered the line the tool calculates the profile of your grid along that line and generates a chart of the profiles, in addition the chart displays red or green sections indicating if the section is in your line of sight. The visibility tool allows you to drag a line indicating where the observer is standing and where they are looking towards. The script then write out the angle of view and generates a visibility grid.

Requires: The Spatial Analyst be loaded and a View DocGUI that contain a tool bar.




FSRN Home Page / GIS/RS Helpdesk Page / GIS/RS Intro Page