
Editing geodatabase topology
It's very important to have a comprehensive understanding of our dataset and the spatial relationships between features before choosing the right rules for a topology and the right solution to correct the errors. When you inspect the error, firstly identify the features involved, secondly understand what is causing the error from a geometrical point of view, and thirdly use the proper solution. There are different solutions to the same error:
- Use a predefined fix
- Combine a predefined fix with manual edits
- Manually edit features
Note
For more details about the editing topology, please refer to the online ArcGIS Help (10.2) by navigating to Desktop | Editing | Editing topology at http://resources.arcgis.com/en/help/main/10.2.
Getting ready
In this section, we will display the topology layer in ArcMap, and test different methods to fix the topology errors identified in the previous recipe.
The main steps in editing a topology are:
- Open the topology in ArcMap.
- Symbolize your topology by the error type.
- Examine the list of errors with Error Inspector.
- Use Fix Topology Error to examine errors individually.
- Use predefined fixes to correct an error / manually correct an error by using ArcMap's editing tools or Topology Edit Tool.
- Define exceptions to the rule.
- Display the dirty areas and validate the topology.
- Save the edits.
How to do it...
Follow these steps to edit LandUse_Topology
in ArcMap:
- Start ArcMap, and open an existing map document
EditingTopology.mxd
from<drive>:\PacktPublishing\Data\EditingData
. Click on the Add Data button, and loadLandUse_Topology
from...\Data\TOPO5000.gdb\LandUse
. SelectYes
in the pop-up window to add all feature classes that participate inLandUse_Topology
. - In the Table Of Contents section, drag the
BuildingsR
layer above theLandUse
layer. Set the transparency forBuildingsR
andLandUse
at60
percent. - Right-click on
LandUse_Topology
, and navigate to Properties | Symbology. Notice that the error features may be points, lines, or polygons depending on the error types. Inspect all other tabs to review the ranks, rules, and errors from the previous recipe, Creating geodatabase topology. Click on OK to close the window. - Start an edit session. Click on the drop-down arrow from the right-hand side of the Editor toolbar, and select Customize. Check the Topology toolbar, and click on Close. Select the Error Inspector tool from the Topology toolbar and dock the window at the bottom of the ArcMap window, as shown in the following screenshot:
- Uncheck Visible Extent Only, select <Errors from all rules> in the Show drop-down list, and click on the Search Now button. Inspect the rules and the columns in the Error Inspector window. If we click on any of the column headings, we change the order of the errors accordingly. If we select a row, we see the selected error on the map. The Shape column tells you about the error geometry: polygon error, polyline error, or point error.
- Let's examine and correct some errors with the Fix Topology Error tool. First select <BuildingsR: Dwelling-Must Be Covered By-LandUse:Other terrains> in the Show drop-down list, and click on the Search Now button.
- Select the first error, shown as Must Be Covered By | BuildingsR:Dwelling | LandUse:Other terrains | Polygon | 72 | 0 | False. Right-click on the error, and choose Zoom To. The
Dwelling
subtype is on theArable
parcel. This is a violation of the rule that says that theOther terrains
subtype parcel must contain only theDwelling
subtype buildings. Because the orthophoto map is from 2012, and some changes could have happened, we can assume that this error could be a false error, and we will declare it as an exception to the rule. With the Fix Topology Error tool, select the error, right-click on the map, and select Mark as Exception. To see this exception, check Exceptions in the Error Inspector window. Click on Search Now to refresh the rows. - Select the next error, shown as Must Be Covered By | BuildingsR:Dwelling | LandUse:Other terrains | Polygon | 77 | 0 | False. Right-click on the error, and choose Zoom To. The dwelling is overlapping on two parcels. This is a real error, and you should correct it. How do you do it? With the Fix Topology Error tool, select the error, right-click on the map, and select Select Features.
- There are three main possible solutions: delete a vertex, use Topology Edit Tool, or use Reshape Edge Tool and slightly shift the buildings.
- First solution: Click on Edit Vertices from the Edit toolbar. With the pointer on vertex 4, right-click on and choose Delete Vertex, as shown in the following screenshot:
- Second solution: Click on Topology Edit Tool, and select edge (1). Select the Reshape Edge Tool option, and draw a line between points (2) and (3), as shown in the following screenshot. To unselect the edge, click on Reshape Edge Tool, and click outside the building feature.
- Third solution: With the building selected, click on Rotate Tool from the Editor toolbar, press the A key to set the rotate angle at
4
gons. Type4
, and press the Enter key. Click on Edit Vertices from the Edit toolbar, and delete the cracking points that were added on both the edges of the building in the validation process.
As we can see, the last solution seems to be more proper for the building because the geometry of the building remains unchanged.
- First solution: Click on Edit Vertices from the Edit toolbar. With the pointer on vertex 4, right-click on and choose Delete Vertex, as shown in the following screenshot:
- Unselect the feature with Clear Selected Features from the Standard toolbar. Because we edited a feature, let's see the dirty area. Right-click on
LandUse_Topology
, and navigate to Properties | Symbology. Check the Dirty Areas option, and click on OK. You will see a small blue hatched rectangle. This means that your topology needs to be validated on this area. Select Validate Topology in Specified Area, and draw a bigger box on your dirty area. Now your area is validated, and the error has disappeared from the list. - Let's continue to correct errors for the
LandUse
layer. In the Error Inspector window, select < LandUse-Must Not Have Gaps> in the Show drop-down list, and click on the Search Now button. Select the first error, right-click on the error, and choose Zoom To. The error delineates the entire area. This is a false error, which you will declare as an exception to the rule. With the Fix Topology Error tool, select the error, right-click on the map, and select Mark as Exception. Click on Search Now to refresh the rows. - Select the second error in the Error Inspector window, right-click on the error, and choose Zoom To. With Fix Topology Error, right-click on the map, and choose Select Features. There are two possible solutions: use a predefined fix or edit the vertices, which are explained in detail here:
- First solution: With the Fix Topology Error tool, select the error, right-click on the map, and choose the predefined fix: Create Feature. You now have a new feature that fills the gap. Select both parcels and use Merge from the Editor toolbar to merge polygons (1) and (2) as shown in following screenshot:
- Second solution: Select the parcel, and click on Edit Vertices from the Edit toolbar. With the pointer on the vertex, drag the vertex from point (1) to point (2).
- First solution: With the Fix Topology Error tool, select the error, right-click on the map, and choose the predefined fix: Create Feature. You now have a new feature that fills the gap. Select both parcels and use Merge from the Editor toolbar to merge polygons (1) and (2) as shown in following screenshot:
- Use the Validate Topology In Current Extent tool to validate the changes you have made.
- In the Error Inspector window, select < LandUse-Must Not Overlap> in the Show drop-down list, and click on the Search Now button. Select the first polygon error, right-click on the error, and choose Zoom To. With the Fix Topology Error tool, select the error, right-click on the map, and select Merge, as shown in the preceding screenshot. In the Merge window, select
Built-up area (LandUse)
, and click on OK. Click on Search Now to refresh the rows. Correct the second error yourself using the same steps. Consider as exceptions the last four errors from the < LandUse-Must Not Overlap> list. Select all four errors at once, and right-click on and choose Mark as Exception. If you change your mind, just right-click on and choose Mark as Error. - Zoom to Full Extent, validate using the Validate Topology In Current Extent tool, and refresh the error list in the Error Inspector window.
- Save your edits and stop the edit session. Save the map document to
<drive>:\PacktPublishing\Data\EditingData
asMyEditingTopology.mxd
.
You can find the results at ...\Data\EditingData\MyTopologyResults\EditingTopology.mxd
.
How it works...
The validation of spatial data and correction of the topological errors improve the quality of our data but do not increase the accuracy of our spatial data.
The small overshoot and undershoot errors can be fixed through the validation process as shown in the following screenshot:

Do not increase the value of cluster tolerance to automatically fix this kind of error in your spatial dataset.
The topology validation is an iterative process. The simultaneous use of different topological rules should be performed moderately. Try to keep the number of topology rules as small as possible.
We have noticed that a single mistake in feature geometry might violate multiple rules and generate different geometry errors (for example, polygon and polyline errors at the same time). The correction of some topological errors might generate new topological errors notified by other topological rules applied to the datasets. In order to avoid the recurrent correction of the errors on the same vectors, it is recommended that you create, for example, a topology only for features from LandUse
. After we have corrected all errors between features from the same feature class, we should delete the topology. After that, we can create another topology between the BuildingsR
and LandUse
feature classes.
Another good idea is that we should first create a topology, and after that, we should create relationships and define relationship rules between the BuildingsR
and LandUse
feature classes (the Creating a relationship class recipe of Chapter 1, Designing Geodatabase). Otherwise, we have to pay attention to those relationships while correcting the topology errors.
The Must be larger than cluster tolerance rule helps us to identify the small residual polygons or polylines resulted in the edit process or from different geoprocessing tasks. As a general practice, there is an order of correcting errors from a topology as follows: correct the polygon errors, correct the polyline errors, and finally correct the point errors.
There's more...
Some of the topology errors can be considered false errors , which means that involved features will not obey the topology rules. Most of the time, those kinds of errors have to be identified by the operator and be declared as exceptions to the topological rules.
In ArcCatalog, inspect the properties of WatercourseL_Topology
from ...\Data\EditingData\MyTopologyResults\TOPO5000.gdb\Hydrography
. For all 23 errors, refer to the Must not have dangle rule that constrains the vectors from being connected to other vectors. This significant number of errors could suggest that rivers from the hydrography network are disconnected. These point errors are false. Only one error has been really identified, the rest of the errors having been declared as exceptions:

In the quality control report, we should mention the number of identified and corrected errors. It is also necessary to specify the number of exceptions to prevent the following overall assessment: your spatial data has been created with a doubtful quality and significant corrections were applied.