News

ArcUser Online


Search ArcUser

newlogo2
The Magazine for
Esri Software Users
 
Home
Subscribe
Advertise
Current Issue
Previous Issues
Submit an Article
What is ArcUser?

Modeling with
ArcView GIS


Are You New
to GIS?
 
 
 

Hot Linking with ArcView GIS

By Monica Pratt, ArcUser Editor

What You'll Need

Hot linking is another way to use geography to organize and provide context for many kinds of information. Hot linking, functionality built into ArcView GIS, provides direct access to external files, project components, or applications from within a project. Simply clicking on a hot linked feature with the Hot Link tool lets the user view photographs, building floor plans, legal documents, video clips, and Internet sites or run applications from an ArcView GIS project. A hot link can also be used to link other documents such as views, tables, charts, and layouts in an ArcView GIS project. A printer-friendly version of this article is available.

Using Hot Linking

Using a hot link that has been defined for a feature is very easy. In an ArcView GIS project, open a view that contains a hot linked feature.

  1. Make sure that the hot linked feature's theme is active.
  2. Click on the Hot Link tool in the view interface. It has a lightning bolt icon.
  3. Click on the linked feature in the view. The linked image or other item should appear in a separate window. If the computer beeps and does not display the item, the linked item could not be found.

How Hot Linking Works

ArcView GIS performs an action, such as displaying an image, and uses a field in the attribute table of the feature's theme containing information, such as the path and name for an image file, as the input for that action. There is no default hot link definition so hot links must always be defined by creating an input field, populating it with appropriate values, and using the Hot Link feature of the Theme Properties dialog box to establish the link between the action and the input.

Several common actions are predefined by the Hot Link feature. These predefined choices include Link Image to File, Link to Document, and Link to Text File. Each feature in a theme can be linked to a different item but all linked items in the same theme must be of the same type (i.e., all items must be images, documents, or text files).

Table 1: Supported Image File Formats

  • X-Bitmap (generated by `bitmap' utility on X Windows)
  • MacPaint
  • Microsoft Device-Independent Bitmap (DIB)
  • Sun raster files
  • X Windows Dump format (XWD)
  • Graphics Interchange Format (GIF)
  • Tagged Image File Format (TIFF)
  • TIFF/LZW compressed image data

See Table 1 for the list of supported image file formats that can be hot linked. Another ArcView GIS document such as a table, view, or chart can be accessed using Link to Document. Link to Text File links a feature to text in a field in the attribute table, not to an entire text file.

Word documents or other text files can be displayed by using a separate Avenue script that starts an application such as Microsoft Word. Avenue scripts can be used to extend hot linking by invoking many other types of applications.

Adding Simple but Useful Functionality

Predefined choices in the Theme Properties dialog are the easiest way to use hot linking. Although this tutorial refers to a sample project created with files available from the ArcUser Online Web site, the steps described provide general instruction on using hot linking. Linking a feature, such as an address, to an image, such as a photo of the building at that address, is probably the most common use of hot linking. This tutorial describes how to link polygon features describing three California parks to photographs of these parks. Download the sample data from the table of contents page for the January-March 2001 issue at the ArcUser Online Web site. The self-extracting zipped file contains shapefiles for the park, county, and state boundaries and the images that will be linked.

Using Predefined Hot Linking

  1. Use Windows Explorer to create a directory at or near the root directory called hotlink. Create two folders under this directory called shpfiles and images. Place the ca_parks and ca_outline shapefiles into the shpfiles folder. Place the three image files, deathv.tif, joshua.tif, and yosemite.zip, in the images folder.
  2. Start ArcView GIS and create a new project.
  3. Choose File > Set Working Directory and type [letter of hard drive]:\hotlink\shpfiles in the text box next to "Specify new work directory." Save the project with the name hotlink.
  4. Create a new view. Choose View > Properties and name the view California Parks.
  5. Choose View > Add Theme or click on the Add Theme button and navigate to the location of the ca_parks and ca_ou shapefiles. Add both files to the view. Make the ca_ou shapefile theme active and choose View > Properties to change its name to California Outline. Make ca_parks active and choose View > Properties to change its name to Parks.
  6. With the Parks theme active, choose Theme > Table from the menu or click on the Theme Table button to bring up the attribute table. The interface will change to the Table GUI and the menu choices will be different.
  7. Choose Table > Start Editing from the menu. This makes the table editable so that a new field can be added to it. If Start Editing is unavailable (the menu choice is grayed out), follow the directions in the next section.
  8. If Add Field is available, skip to the section "Create and Populate an Input Field."

If the Start Editing is Unavailable

  1. If the Add Field menu choice is unavailable (grayed out) this means that the data for this theme cannot be written to because it is on a medium that you can't write such as CD-ROM and/or is write-protected (i.e., it is a file you do not have permission to change). This problem should not occur when using the sample data for the tutorial but may happen when hot linking features for projects.
  2. To use data originating from a nonwriteable source, make a copy of the source data for the theme and place it on a drive or media that can be changed such as your local hard drive. Make sure to copy all three files that make up a shapefile. The parts of a shapefile are the .shp file that stores the feature geometry, the .shx file that stores the index of the feature geometry, and the .dbf file that stores the attribute information of features in dBASE format.
  3. If this still does not allow you to edit the table, it may be necessary to remove the read-only attribute from the file so that it can be changed. Use Windows Explorer to locate the file and right-click on the file name of the new copy of the data. This will bring up the context menu. Choose Properties to see the properties dialog for this file. Click on the box next to read-only in the Attributes section to uncheck it. Repeat this process for the other two files that make up the shapefile.
  4. Add the shapefile from the newly copied data source as a theme and delete the old theme by making it active and choosing Edit > Delete Themes from the menu. Remember that the data is not being deleted-only the reference to the data in the project file (apr).
  5. Save the project.
Query table

Use Query Builder to locate specific park boundary polygons.

Create and Populate an Input Field

Before the images can be linked to features in the Parks theme, the attribute table for the Park theme must contain a field to hold the linked file name.




  1. Choose Edit > Add Field from the menu. Clicking on Add Field brings up the Add Field dialog box.
  2. In the Name field, type "hl_image." This example will link images to features.
  3. In the Type field, choose String from the drop-down box.
  4. The value for the Width field will depend on the length of the path to the location of the images that will be linked. For this example, type in 30.
  5. Click OK to close out of this dialog box. The new field will appear in the table.
  6. Rather than scrolling through all the fields in this table to find the three features that will be linked to images, use the Query Builder to locate these features. Click on the Query Builder button in the button bar. In the Query Builder dialog box, double-click on the Name field, and double-click on the equal sign. Scroll through the Values, locate Death Valley NP, and double-click on it. The query [Name] = "Death Valley NP" will appear in the text box. Click on the New Set button.
  7. Delete the first query and build two more queries in the same manner for Joshua Tree NP and Yosemite but click on the Add to Set button after each of these queries. Click on the Promote button, typically located next to the Query Builder button, or choose Table > Promote from the menu to bring the selected records to the top of the list.
  8. promote

    Promote all selected records to the top of the table.

  9. Click on the Edit tool, which has an I-bar with an arrow as its icon. Click in the field under hl_image for the Death Valley record and type the path and file name for the Death Valley image (i.e., c:\hotlink\images\deathv.tif). Make sure to include the entire path and spell all names correctly. Make sure to hit the return key when finished typing. The edits will not be saved if you do not hit the return key. Add the path and file names for the Joshua Tree (joshua.tif) and Yosemite (yosemite.tif) images. Make sure to hit the return key after each entry.
  10. Choose Table > Stop Editing and click on Yes to save the edits.
  11. Save the project.

Defining a Hot Link

The next step will use the Hot Link feature of the Theme Properties box to associate the hl_image field in the Park attribute table using predefined hot links.

  1. Return to the California Parks view. With the Parks theme still active, click on the Theme Properties button.
  2. In the Theme Properties dialog box, scroll down and select the Hot Link feature. For Field, pick hl_image from the drop-down box. For Predefined Action, choose Link to Image File. This will cause the Script box to display the name of the appropriate script, Link.Image.File. Click OK to dismiss this dialog box and return to the view.
  3. The Hot Link tool will now be available (i.e., not grayed out). Click on it and use this tool to click on one of the three hot links that were just defined. Clicking on the Death Valley polygon in the Parks theme brings up the linked photo in a separate window.
Link to Image

Link to Image ties images, such as photos or scanned documents, to features.


Linking to an ArcView GIS Document

Features in a theme may be related to information in another view, table, or chart in an ArcView GIS project. Hot linking can make this connection very clear. The next process will create a new view called County Boundaries and link a feature in the California Parks view to it.

  1. Make the Parks theme active and choose Edit & Copy from the menu to place this theme on the ArcView GIS clipboard.
  2. Create a new view. Choose View & Properties to name this second view County Boundaries.
  3. Choose Edit > Paste to add the Parks theme to this view and make it visible.
  4. Click on the Add theme button and navigate to the ca_co shapefile and add to the view. Choose Theme > Properties and name it Counties. In the legend, make the Counties theme visible and drag it below the Parks theme.
  5. Return to the California Parks view and make the California Outline theme active. Open its attribute table. This shapefile has only one feature, a single polygon defining the outline of the State.
  6. Choose Table > Start Editing and Edit > Add Field. Create a new field called hl_doc.
  7. Click on the Edit tool (I-bar with an arrow icon) and click on the record field under hl_doc. Type in "County Boundaries," the name of the view document to link to, and hit return. Choose Table > Stop Editing and click on Yes to save the edits.
  8. Choose Theme > Properties and select the Hot Link feature. In the Hot Link dialog box, choose hl_doc for the field and Link to Document for the predefined action. The correct script will automatically appear. Click on OK to close the dialog box.
  9. Save the project.
  10. Verify that this hot link works by making the California Outline theme active, selecting the Hot Link tool and using it to click on anywhere inside the outline of the State. The County Boundaries view should open up.
Link documents in a project

Link view or other documents in a project together using hot link.

Putting Hot Linking to Work

Just using the built-in linking capabilities of ArcView GIS will enhance projects with new types of data and can help users navigate through projects more effectively.

To expand the use of hot linking, look at Link.ImageFile and the other predefined hot link scripts used by the system to see how these scripts work. For an example that shows how to hot link a feature to another application, search the online help for ArcView GIS for "hotlink, example script."

For a description and script for linking a project to a Web site, see "Hot Linking to the World" by Jim Barry which originally appeared in the July–September 1998 issue of ArcUser magazine, is available with the online version of this article. Download the script. Many useful scripts and extensions for hot linking have been written by users. Visit the ArcScripts page at the Esri Web site and search on "hotlink" to locate and download these scripts and extensions at no charge.


Contact Us | Privacy | Legal | Site Map