Recipe for cleaning up a shapefile Heidi van Deventer , November 2011 There are two ways to capture a polygon coverage / shapefile to ensure topology: 1. Capture the whole area as lines which snap together and then convert it to a polygon, then assign attributes. This the old convention of Unix ArcInfo, in which I was trained, so I always prefer this one, but some call me old fashioned. 2. Capture the first polygon, then use the autocomplete tool for any adjacent polygons. I still find this one problematic, therefore I use the first method. There are a number of ways to clean up a shapefile: 1. You can convert it back to lines, remove duplicate lines, build it as a polygon and reassign attributes. 2. You can separate each polygon as a separate shapefile, create an encompassing shp, intersect / union all together, cut the polygons, assign attributes and then dissolve. 3. Fix it with Geobox tools (I am not familiar with this, but the tools are available). Choice to fix depends on the amount of polygons captured and amount of detail. I ways find the first option still the best. Therefore steps below only of first one: Fixing a polygon shapefile’s topology by converting it back to lines: I have used an ArcInfo license file for this work. 1. Convert the polygon shapefile to a line shapefile. 1 • • • • • • Use ArcGIS Toolbox > Data Management Tools > Features > Features To Line. Drag or select the Input Features specify the Output Feature Class location and name untick the Preserve attributes (optional) option press OK. Wait for the process to complete: see processing notice below blue scroll bar. The line shp will be added automatically to the Table of Contents (TOC). 2 2. Start editing: • Make sure that only the lines shapefile is selectable: Click on the icon next to the shapefile to unselect it. • • Go to Editor (toolbar), start editing. If there are only a few shp files available for editing it won’t be necessary to choose it, so it goes directly into editing mode. If not, you would have to select the file you need to edit. Select the duplicate boundaries, right click and delete: 3 • • • • Add the Snapping Toolbar and turn on the snapping on the layer. You can either switch on the Edge Snapping option by clicking on the button or the Vertex snapping. The first will snap to any part of the line, the second to the vertex. Double click on the line to show the nodes, and then move the node to the adjacent boundary or vertex on the 90° turn: • 4 • Where a line feature shares a boundary you do not want to delete, then split the line using • the Split Tool Click on the line you want to split, and delete the remainder of the line. .... • Richt-click and insert vertex, then move the edge vertex: • Check for small polygons that are unnecessary; delete them: 5 • • Save the edits regularly so that you don’t lose it: When happy with the edits, go Editor > Stop Editing. Ensure that a single boundary line separates the polygons. • 6 3. Build polygons When done, go to ArcGIS Toolbox > Data Management Tools > Features > Features To Polygon, and add the line shapefile as the Input Feature, specify the location and name of the output feature, and untick the Preserve attributes option. Once completed, open the attribute table and quality check the results. Sliver polygons may still appear, as shown in the example below. To solve this problem: give the sliver polygons the same ID as one of the adjacent polygons, and then run a dissolve. If they are too many, you may consider amending the line shapefile and converting the corrected line shapefile to a new polygon shapefile. 7 8 • • • • • Go to ArcGIS Toolbox > Data Management Tools > Generalization > Dissolve. Add the Input Features, specify the output location and file name, select the field to dissolve on, and untick the Create multipart features option. Press OK. Do a final quality check by switching on the original layer’s labels, as well as the final amended layer’s labels, and check that they are the same. You can open the attribute table too, and check if there are only 5 records for the 5 polygons. Hope this helps! Heidi 9
© Copyright 2026 Paperzz