Spring 2013ArcGIS for GeoscientistsGEOL 596

Lab 5: Using lines to derive polygons

Topology and feature classes

A geologic map includes a layer of colors that show different rock types; the colored polygons are bounded by lines that can be faults or contacts or the boundary of your map area. For that reason, it makes sense to draw the lines first – just as you would do on a paper map – and then create the polygons based on those lines. This is a multi-step process, naturally, and it is not really worth doing until you are happy with where all of your lines are. Here’s a quick run-through of the procedure:

  1. Draw your lines in a line feature class. Make sure snapping is turned on so that you can connect lines precisely.
  2. Create a topology and add rules to it in order to test your line layer and make sure that all the lines connect as you want them to.
  3. Validate the topology against your lines layer to look for errors, and fix any errors.
  4. Create a polygon feature class and create a polygon template in order to edit that feature class.
  5. Build polygons from the lines and edit the attributes of the polygons (primarily by adding unit names like Qal).
  6. Edit the symbology (color of the polygons, primarily) based on the attributes.

In the last lab, we worked on drawing and editing lines. In this lab, we’ll do the rest.

Creating and using a topology

Topologies sound mysterious and complicated, and they are somewhat less than intuitive to create. The idea behind them is really basic, though: it’s kind of like spell-check in a word processing program. You tell it what rules you want it to follow, and it scans through your data and lets you know where the rules are broken. Because it is spatial data, however, the rules are a little bit more complicated (kind of like all of those geology vocabulary words that aren’t automatically in your Word dictionary). You don’t have to create a topology to make polygons, the same way you don’t have to use spell-check to print your document, but it saves you some work in the long run (as spell-check saves you much embarrassment). So here goes:

  1. Launch ArcCatalog and open the Toolbox.
  2. In the Toolbox, open Data Management  Topology.
  3. The first thing you need to do is Create Topology. This is like creating an empty box in your feature dataset.

Select your feature dataset (NOT a feature class at this point – it won’t let you do that). In your output topology, I suggest including the word “topology” in the name. Click OK.

  1. Arc will churn on this for a bit, and then your new topology will show up in your catalog tree in the left navigation. Once it does, you can right-click on it and select Properties.
  1. The Topology Properties dialogue box allows you to add feature classes and define the rules you want to use to look for errors.

Click on the Feature Classes tab and click the Add Class… button. You will then choose your faults_and_contacts feature class, or whatever line feature class you’ve been working on.

  1. Now click on the Rules tab and the Add Rules… button. These will look impenetrable initially, but as you click on the rules, they are illustrated to the right.

You can generally get away with just a couple of rules:

  1. Must not overlap (this can create little skinny polygons where you don’t want them)
  2. Must not have dangles (in reality, you can have dangles, but you want to know where they are – more on that later)

It’s possible you will want others, like Must not self-intersect. Add the rules one at a time, then click OK on the main Topology Properties dialogue box when you are done.

  1. In the Catalog tree, right-click on your topology again, and select Validate Topology. This runs all of the rules on your feature class and looks for any errors. The first check takes the longest – all subsequent validations only look at the areas that you have edited since you last validated. When validation finishes, if you don’t have any errors, that’s great! If you do, you can look at your topology in the Preview window in ArcCatalog and see where they are. But you really want to look at this is ArcMap, where you can see these in context and edit them.
  2. Launch ArcMap and load the map you’ve been working on.
  3. Add your topology the same way you add a feature class. If you have errors, you will now see exactly where they are and if you need to fix them (you might not need to fix all of the dangles, for example, if concealed faults peter out in alluvium). Now you can turn on editing and make changes.
  4. Once you think you’ve corrected everything that needs correcting, you can re-validate the topology again. You can do this directly from ArcMap by loading the Topology toolbar. Note that editing still needs to be turned on in order for this toolbar to work.

Hover over the icons to find the one you need. Keep in mind that you don’t have to fix all of the errors that the topology finds if they won’t affect how your polygons are made. But as you make edits, the errors should be fewer.

  1. Save your edits, and save your map.

OK! Once you are happy with how all of your lines intersect, you are ready to build polygons.

Building polygons from lines

When you build polygons from lines, you are creating new features that need to have a feature class to go into. Creating feature classes is something you do in ArcCatalog, and you can’t have a map open that uses the feature dataset when you make new feature classes.

  1. If ArcMap is open, save all of your work (edits and the map document) and close it. Launch ArcCatalog.
  2. Right-click on your feature dataset and select New  Feature Class.
  3. You’ve done this before, but it may have been a while. Now you are creating a polygon feature class, and you should name it something appropriate (Rock_units, perhaps, or something like that). Work your way through the additional steps of the wizard. When you get to the screen that allows you to add fields,

be sure to add a field for the Unit name. You might also add a field for notes, or anything else you feel is relevant. Click Finish.

  1. Launch ArcMap, load your map, and add the polygon feature class you just created.
  2. Start an editing session (click on Editor  Start Editing).
  3. Create a template for your polygon layer (same way that you created a template for your line layer last week).
  4. Click on Editor again, and select More Editing  Advanced Editing Tools. That should open the Advanced Editing toolbar.

When you initially open it, probably not all of the tools will be highlighted or selectable. Similar to the regular editing toolbar, you often have to have features selected in order for the tools to become “available” for use.

  1. Using the selection arrow , select all of the lines in your faults_and_contacts layer. (You might want to turn off other layers in order to do this.)
  2. Click on the Construct Polygons icon in the Advanced Editing Toolbar. If you receive an error message like this one:

it means that you need to add the polygon feature class you created to the map, create a template for editing the features, and make sure that it is visible. Hopefully, you will instead get this dialogue box:

The template you just created for your polygons should be automatically selected. You can leave the default value for the cluster tolerance, and click OK.

Ta da! You now have polygon features that share the exact same boundaries as your faults and contacts.

  1. The next step is to fill in the units in the attribute table. There are number of ways you can do this. You can select them one by one and fill in the attributes in the editing window on the right-hand side of the map; you can open the attribute table for the whole feature class and move through the list, which will select features in the map and you can fill it in; you can select all of the features you know to be a given unit, open the attribute table for all of those features, and fill them in all at once. Whichever you prefer.
  2. Now symbology. Right-click on the feature class and select Properties; navigate to the Symbology tab and select Categories  Unique Values.
  3. Select Units as your Value Field, and Add All Values. (You’ve done this before.)
  4. Although you are going to select different fill colors for each unit, none of them will have an outline (the lines are coming from your other layer). So you can right-click in the window that shows all of the values and select Properties for all symbols. When the symbol selector box comes up, select No Color for the outline color. (This is actually something you could have done in creating the template, if you were thinking ahead.)

Click OK.

  1. Now you can right-click on each unit and select a color for each one. Keep in mind geologic conventions, primarily yellows for Quaternary sedimentary units. Click Apply.
  2. Once you have all of your colors selected, you can do a few other things to make your map look nice. Before, you colored your map using your DEM. Now, turn off the colored DEM layer and adjust the transparency on your units layer (in the Display tab).

Now you want to be able to display the unit names for each polygon. One way to do this is with labeling; in the past, however, I have found this problematic and went with a different route, which I’ll describe here.

  1. Back in ArcCatalog, open the Toolbox (if it isn’t already open) and open Data Management  Features. Double-click on Feature to Point.
  2. In the dialogue box, select your polygon feature class as the input. The output will be automatically filled in, but click on the folder to (1) make sure that it is going to your feature dataset, and (2) rename it to something like unit_labels. Leave the “inside” box unchecked. This will create a new point feature class that creates a point feature at the center of each polygon. Click OK.
  3. Add your new point feature class to your map in ArcMap. Right-click on it to open the Properties dialogue box, and select no color for both the fill and outline, so that no symbol appears.
  4. Now navigate to the Labels tab. Check the box in the upper left to label the features, then click on the Placement Properties box.

  1. Select the radio button next to Place label on top of the point. Click OK here, and in the Properties dialogue box as well. You may need to adjust the font and size to get the appearance that you want, but each polygon should now be labeled in the center with its unit name.

Congratulations! You should now have a map showing your geologic units, labeled, and bounded by faults and contacts that have appropriate symbology. You are getting very close to have a complete map!

1