Exploring Error and Uncertainty Related to Datums and Projections Using ArcGIS

Repairing Corrupted Data Using the Define Projection Tool

Table of Contents

  1. Exploring Error and Uncertainty Related to Datums and Projections Using ArcGIS
  2. Skill Drill: Setting Up Your Workspace
  3. Skill Drill: Downloading Data from Natural Earth
  4. Skill Drill: Connect to Your Workspace Folder in ArcMap
  5. Creating a File Geodatabase
  6. Creating Feature Classes from Shapefiles
  7. Adding XY Data using the ArcCatalog Window
  8. Skill Drill: Creating Indicatrices Using the Buffer Tool
  9. Evaluate Distortion Patterns in Map Projections
  10. Measuring Scale Distortion
  11. Skill Drill: Evaluate and Measure Distortion
  12. Troubleshooting Datum Shift
  13. Repairing Corrupted Data Using the Define Projection Tool
  14. Skill Drill: Repairing Incorrect Coordinate System Definitions

As you learned previously, GIS data is often composed of multiple files working together. For example, a shapefile might appear as a single file in ArcMap. When one views the same shapefile using Microsoft File Explorer, one can see that many files are present (Figure 2.56).

Figure 2.56: This image shows the populated places shapefile as seen in Microsoft Windows Explorer. Double-click or tap twice to view the image in a larger size.

Once in a while, these component files get deleted or corrupted for various reasons, and you may encounter a shapefile that is missing the spatial reference information. To correct this issue, you must first understand how a shapefile stores spatial reference information. The file that ends in the .shp extension stores the feature geometry, such as nodes and arcs. As you learned previously, a node is a single XY coordinate pair, such as latitude and longitude, that represent a point feature. An arc is a linear feature made up of nodes, vertices, and line segments. In an arc, the nodes refer to the beginning and ending points of a line feature. Vertices refer to any intermediate points in between the start and endpoints (Figure 2.57).

Figure 2.57: In this image, the black points represent nodes. The green points represent vertices. The blue line segments represent arcs. This type of feature geometry is stored in the file with the .shp extension.

Though the .shp file stores the feature geometry, it does not specify any other spatial reference system information such as which geodetic datum or map projection is used. As you learned earlier, each datum uses slightly different geographic coordinates.  Even though ArcMap may have a shapefile’s latitude and longitude coordinates, without knowing the correct datum to use, ArcMap cannot place the features on the map. For shapefiles, the spatial reference information, including map projection and datum, is stored in the file that ends with .prj (Figure 2.58).

Figure 2.58: The .prj file stores the spatial reference information, including the datum. Double-click or tap twice to view the image in a larger size.

In Microsoft Windows File Explorer, open the original folder. Right-click on the populated places .prj file and select Open with (Figure 2.59).

Figure 2.59: Right-clicking on the .prj file opens the contextual menu in Windows.

When the dialog box opens, choose Notepad from the list of applications (Figure 2.60).

Figure 2.60: If you do not see the Notepad application on the list, click on the More apps link to expand the list of available applications.

Take a few minutes to examine the contents of the .prj file. As you can see, the .prj file contains only text. In this instance, it starts with the geographic coordinate system, followed by the datum information. After that, the prime meridian gets defined. Lastly, the units used for the XY data are provided (Figure 2.61).

Figure 2.61: PRJ files contain only text describing the spatial reference information. Double-click or tap twice to view the image in a larger size.

The ArcGIS software reads this textual information to understand how to use the geographic coordinates stored in the .shp file. Without this information, ArcMap cannot correctly place the features on the map.

In the next few steps, you will intentionally corrupt the shapefile by deleting the .prj file. Close the Notepad application and open the original folder in Microsoft Windows File Explorer. Righ-click on the populated places .prj file and select Delete (Figure 2.62).

Figure 2.62: Right-clicking on the .prj file opens the contextual menu in Windows.

In ArcMap, expand the original folder in the Catalog Tree. Drag and drop the populated places shapefile into the data frame. You should see a warning message appear regarding an unknown spatial reference (Figure 2.63). Take a moment to read through the error message. When done, click OK.

Figure 2.63: This error message warns you that the spatial reference information is missing from the data source.

Currently, you should have the populated places feature class that was from your World Data geodatabase already loaded on the map. Zoom to the west coast of the United States to get a better view of some of the cities in this feature class, such as San Francisco and Los Angeles. You will see that the populated places shapefile is not correctly placed on the map, even though the layer is visible in the Table of Contents (Figure 2.64).

Figure 2.64: Normally, the two layers should overlap perfectly. However, ArcMap does not know how to use the geographic coordinates in the shapefile due to the missing spatial reference information. Double-click or tap twice to view the image in a larger size.

When zoomed out, the undefined layer appears as a single dot. However, all of the point features are still present. In the Table of Contents, right-click on the populated places shapefile that has the unknown spatial reference. Choose, Zoom to Layer. As you can see, all of the point features are drawn correctly relative to each other. It is the size and location that is incorrect due to the missing spatial reference information (Figure 2.65). If you open the layer properties for the undefined populated places shapefile and check the spatial reference, you will see that ArcMap describes the spatial reference as undefined. There are also no units assigned to the data. When ArcMap encounters an undefined spatial reference, it uses the linear units defined in the data frame display projection. In this instance, ArcMap ended up interpreting the longitude and latitude values as feet.

Figure 2.65: Without spatial reference information, ArcMap can draw the features of the shapefile, but cannot project them correctly. Double-click or tap twice to view the image in a larger size.

To correct this problem, you must replace the missing .prj file. In the Catalog Window, click the plus sign next to Toolboxes. Expand the System Toolboxes, then Data Management Tools. Scroll down and expand Projections and Transformations and double-click the Define Projection tool (Figure 2.66).

Figure 2.66: The Define Projection tool is used for creating new .prj files.

In ArcMap, choose the populated places shapefile with the unknown coordinate system as the input. For the Coordinate System, click the button on the right. In the Spatial References Properties window, open the Layers folder and select GCS WGS 1984. When ready, click OK, then click OK again to run the tool (Figure 2.67).

Figure 2.67: Be sure that your settings match the image shown here.

When geoprocessing is complete, zoom back to the west coast of the United States. The two populated places layers should now align (Figure 2.68). In Microsoft Windows Explorer, you should see the .prj file replaced.

Figure 2.68: The two populated places shapefile and geodatabase feature class should now align. Double-click or tap twice to view the image in a larger size.