Wednesday, March 17, 2010

Georeferencing / Georectification / Geometric Correction in ArcMap

I've done some geometric correction using other software packages, but have not yet tried to do it in ArcMap.  It turns out that there's a pretty small learning curve in the world of georeferencing in ArcMap.  I recommend simply turning on the Georeferencing toolbar and playing around with the hand full of tools that it holds.  All of the most useful tools are hidden away in either the Georeferencing menu on the left of the toolbar or in the small menu of three manual alteration tools to the right of drop down menu of selectable layers.  In the hour or so that I have been attempting to georeference a couple images, I already want to pull the tools out of the drop down menus and place them on the main toolbar for faster access.


A screenshot of the Georeferencing toolbar in ArcMap


Turn on the Georeferencing toolbar:
To verify, turn on the Georeferenceing toolbar by either right clicking in empty gray space beside tool bars/file menus at the top of the ArcMap window, or by going to Tools :: Customize and on the Toolbars tab, place a check mark in the box next to the Georeferencing toolbar option (then click Close).  The toolbar (see above) will appear.

Add imagery:
Use the Add Data button to add a raw, unreferenced images (.jpg, .png, .bmp, etc.) to an ArcMap project.  Expect to receive an "Unknown Spatial Reference" message that explains that the image cannot be projected.  If there are spatial layers already added to the project, the images will probably be displayed somewhere off in a corner.  Right click on the image layer in the table of contents and select Zoom to Layer to view it.

Here are a few good resources to consider to obtain imagery:

Georeferencing:
I have access to rectified imagery and other reference datasets (transportation networks, hydrography, etc.) so I'll use those to illustrate some techniques (very quickly and roughly).  I'll just be using aerial imagery from 2005-2009 and a coverage of State Routes.
  • Zoom to the area where the image should cover.  This example is looking at an area in Florida around Taylor Creek, just north of Lake Okeechobee:











  • Choose an image to manipulate from the Layer menu on the Georeferencing toolbar

  • Since my .jpg image (in this case) is hiding down at the grid origin, somewhere in the Gulf of Mexico, I will have a hard time matching similar locations in the relation process.  Open the Georeferencing menu on the toolbar and select Fit to Display.  The image will shift into view and be resized to fill your map view.

  • Begin by using the three tools in the menu to the right of the Layer menu to roughly align the image:
    • Primarily, it seems that the images are rotated about 90° clockwise (north is pointing east). Use the Rotate tool to fix this. The original top of the raw JPEG is now facing west:
      (This can also be performed from the Georeferencing menu under Flip or Rotate :: Rotate Left)
Rotated the image 90° anti-clockwise so north
(Click to enlarge images)
    • Next, use the Scale tool to shrink the image a bit:
 
Shrink the image with the scale too
    • Finally, use the shift tool to move the image closer to its correct position:
 Moved the image using the shift tool
  •  Open the Link Table by clicking the button on the far right of the Georeferencing toolbar.  This will keep track of the control points that will be added in the next step.

  • Zoom in to a location that is easily distinguishable in the rectification image as well as any reference data.  Roadways are excellent references, especially when they intersect with each other or with a stream, etc.  A less effective reference feature can be a lake or stream, for example, because the shorelines can change over time.  Roadways often have less variation.  Local knowledge is very beneficial in these situations.

    Below is an example of a roadway intersection that is a decent enough reference point to use.  The red circle indicates where the control points will be placed:
(Broken GIF: the image should be animated
to illustrate the two control point locations)
  • Use the Add Control Points tool to add pairs of control points.  The first click will represent the "from" location that will correspond to a point on the image that is being rectified (the black & white image in this case).  The second click will represent the "to" position, where the image will be moved or stretched.  This pair of control points creates a vector that is used to rotate, stretch, and skew the image.

    Add a few of these control points across the extent of the rectification image.  Each time a control point is completed, the information will appear in the Link Table, and the image will move (if the Auto Adjust option is checked in the Georeferencing menu).

    Note the Total RMS Error that is reported in the lower right corner of the Link Table window.  Root Mean Square Error is "a measure of the difference between locations that are known and locations that have been interpolated or digitized" (Heather Kennedy. 2000. ESRI Dictionary of GIS Terminology, ESRI Press, Redlands, CA.). In general, lower values are desirable.  Read more about RMS Error.


  •  It helps to turn layers on and off in the table of contents pane.  Another useful technique is to use the Swipe Layer tool (found on the Effects toolbar).  Make sure that the image/layer/group layer is selected in the Effects toolbar selected layer menu, then select the Swipe Layer tool and click the map view.  Then simply click and drag the tool across a map to reveal lower layers on the map.
Image rectified with various control points
* Caution! Changing the selected layer on the
Georeferencing toolbar will remove any editing
or work that has been done to an image. Use the
following methods to preserve your referencing
Save image referencing:
  •  From the Georeferencing menu, simply choose Update Georeferencing
This adds two files ( [image name].aux & [image name].JGw ) to the directory where the image is located.  These two files are referenced when the image is added to a project,future

(Optional) Export image:
  •  From the Georeferencing menu, choose Rectify to bring up the Save As dialog

  • Change the Output Location (choose a folder or workspace), and change the name of the image if necessary.  The remaining parameters can be left with the default settings.  Click Save to continue.

  • Use the Add Data button again to add the new image to the project, or distribute as necessary

Remove null values:
After adding the image, you may notice a black box surrounding the image.  This is simply the blank space left when the new image was created from an image that was rotated slightly.  These null values have the value of 0 in the dataset and can be easily removed:
  • Right click on the image layer in the table of contents pane and choose Properties (or double click on the layer)
  • Navigate to the Symbology tab
  • Place a check next to Display Background Value setting.  Ensure that 0 is the denoted value, and that the color selector is set to No Color.  Choose Apply or OK to continue

    Removing null values from the layer

    Several georeferenced images

    One problem remains.  There are still some black outlines on the edges of these images.  Those areas are inherited from the original raw images.  These can be handled in two ways;
    1. The images can be cropped from the original JPEG files before they are georeferenced to remove the outlines.  Be sure to make copies of the original images before any editing is applied.
    2. Manipulate the geographic extent of each layer:
      • Open the layer properties for an image
      • Navigate to the Extent tab
      • Change the "Set the extent to" option to "a custom extent entered below"
      • Increase (Left & Bottom) or decrease (Top & Right) the Visible Extent values by small intervals and click Apply to view the results.

        * Reset the values if necessary by changing the "Set the extent to" option to "the default extent of this layer"

      Several georeferenced images with altered geographic extents

      If this is still not suitable, you may need to pre-process the image with some other graphics software.

      More information: