Showing posts with label ArcMap. Show all posts
Showing posts with label ArcMap. Show all posts

Thursday, February 18, 2010

Hyperlinking Photos in ArcPad and ArcGIS

Here are some quick and simple steps to allow you to view photos linked to features.

For this example, we will assume that we have a point feature class called "Trees", with a field called "Photo" which contains the file name of the photo linked to that feature. All of our photos are stored in c:\Photos.

ArcPad
  1. Open ArcPad, and add the trees layer to your map
  2. Open the Table of Contents
  3. Open the Layer Properties for that layer
  4. Go to the Hyperlink page
  5. Set the Hyperlink field to Photo
  6. Set the default hyperlink path to the folder that contains the photos
  7. Click OK twice to close the dialogs
  8. Use the Hyperlink tool from the Browse toolbar to select the tree on the map. If a photo is found, it will be opened for viewing.


ArcGIS: HTML Popups
  1. Open ArcMap, and add your Trees feature class
  2. Open the layer properties
  3. Switch to the HTML Popup page
  4. Check the "Show content for this layer using the HTML Popup tool" option
  5. Select "As a URL"
  6. In the prefix box, enter "C:\Photos" - the folder containing the photos.
  7. Select Photo as the hyperlink field
  8. Leave the suffix blank (supposing the file names already have the .jpg extension)
  9. Click OK.
  10. Use the HTML Popup tool
    to select features from the map. A small window will "pop up" from the point showing the photo for that feature.

ArcGIS: Hyperlinking
  1. Open ArcMap, and add your Trees feature class
  2. Open the layer properties
  3. Switch to the Display page
  4. Check "Support Hyperlink using field:"
  5. Specify the hyperlink field to "Photo"
  6. Click OK
  7. Use the hyperlink tool to select features from the map.

Note: With hypperlinking, you will need either an absolute or relative path in the Photo field for this tool to work. An easy way to add these prefixes to the attribute is using these ArcMap field calculations.


Tuesday, August 25, 2009

ArcMap Field Calculations

Often in a feature class, you will have an attribute which stores the file name and path of a file that is linked to that feature. For example, you may have a photo, a video or a condition report (PDF) which contains additional information about the feature. You can then use the Hyperlinking functionality in ArcMap to view the files via your map.

If you are storing the file paths as full paths (as opposed to relative), you may encounter some problems if you want to move the location of the images, reports etc. You could manually go through and update the paths, or you can use these simple field calculations.

Change File Paths
FileField = [FILE_PATH]
OrigPath = "D:\Temp"
NewPath = "C:\temp"
output = Replace(
FileField , OrigPath, NewPath )

Remove File Path
FileField = [FILE_PATH]
iLength = Len (
FileField )
iLastInd = InStrRev (
FileField , "\" )
iDif =
iLength - iLastInd
output = Right ( FileField , iDif )

To use them:
  1. Open the table of the feature class in ArcMap
  2. Start an edit session
  3. Right click on the column header, and select Field Calculator
  4. Click the advanced check box
  5. Copy the script into the "Pre-Logic VBA Script Code" box
  6. Replace the FileField property to the field that contains the file path in your feature class (delete the [FILE_PATH] part, and double click the appropriate field in the Fields List of the calculator)
  7. If changing the file path, update the OrigPath and NewPath variables
  8. Type output into the bottom box
  9. Click ok
  10. Save your edits