Repairing Corrupted Data Using the Define Projection Tool
Table of Contents
- Spatial Error Related to Datums and Projections
- Skill Drill: Setting Up Your Workspace
- Skill Drill: Downloading Data from Natural Earth
- Skill Drill: Connect to Your Workspace Folder in ArcMap
- Creating a File Geodatabase
- Creating Feature Classes from Shapefiles
- Adding XY Data using the ArcCatalog Window
- Skill Drill: Creating Indicatrices Using the Buffer Tool
- Evaluate Distortion Patterns in Map Projections
- Measuring Scale Distortion
- Skill Drill: Evaluate and Measure Distortion
- Troubleshooting Datum Shift
- Repairing Corrupted Data Using the Define Projection Tool
- 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).
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).
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).
In Microsoft Windows File Explorer, open the original folder. Right-click on the populated places .prj file and select Open with (Figure 2.59).
When the dialog box opens, choose Notepad from the list of applications (Figure 2.60).
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).
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).
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.
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).
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.
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).
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).
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.