GEOG 868
Spatial Database Management

Editing a Versioned Feature Class

PrintPrint

Editing a Versioned Feature Class

In our scenario, users logged in as census and as Moe are sharing the responsibility for editing the feature class to reflect when states joined the Union. As the project progresses, snapshots at different moments in time can be taken to produce an historical timeline of the country's expansion.

You will simulate these two users performing their edits by launching a separate ArcGIS Pro application window for each. The users want to isolate their work from the base feature class, so they will create their own versions of the feature class.

A. Perform edits as census user

  1. In your already open ArcGIS Pro window in your remote connection, in the Display pane, click the List By Data Source button (second from the left).  Above the layer name, you should see a heading indicating that you're viewing the DEFAULT version of the feature class.
  2. Right-click on this heading and select Manage Versions.  A Versions view should appear alongside the Map view, showing that there is currently only one version: DEFAULT.  
  3. Click the New Version button on the ribbon.  A new row will be added to the versions table.
    • Assign the version a Name of Statehood_edits
    • Enter the following Description for the version: census user's statehood edits version

      ​The Access options are used to specify who has access to the new version. The Private option means that only the user creating the version will be able to view and edit the version. The Public option means that the version owner and any other database user will be able to view and edit the version. Finally, the Protected option gives other database users the ability to view data through the new version but not perform any edits on it.
       
    • Select the Protected option.
    • Click the Save button on the ribbon to finish creation of this new version.  
    • Close the Versions view.  
  4. Back in the Display pane, right-click on the data source heading above the egdb.CENSUS.us_state_1790 layer again, and this time select Change Version.  In the Change Version dialog, you should see that dbo.DEFAULT is the currently active version, but you should also see CENSUS.Statehood_edits listed as a child version of dbo.DEFAULT.  
  5. Select that Statehood_edits version and click OK.  You should see the data source heading in the Display pane change accordingly.  

    Vermont was the first state after the original 13 to join the Union (in 1791). Its boundaries were already defined as the land between New York and New Hampshire, so no boundary edits are necessary to create it.

    The next state to join was Kentucky (in 1792) which was formed from the western part of Virginia. To create Kentucky, we're going to overlay the states layer we worked with earlier in the course and use the present-day boundaries as a guide. If you were carrying out a project like this in a serious manner, you'd probably want to make sure the two layers aligned better than these do, but we're not going to get bogged down in a detail like that in this demo.

    Note: Rather than adding and symbolizing the states feature class in the next couple of steps, you can also use the Topographic layer that's automatically added to your Pro project from ArcGIS Online since it also shows the present-day Virginia-Kentucky boundary.
  6. To the map, add the states feature class from the egdb.CENSUS.usa_L7 feature dataset that you created back in Lesson 7.
  7. Change the symbology of the states layer so that the polygons are hollow and have an outline color that stands out (e.g., red).
  8. Change the symbology of the us_state_1790 layer so that it has thick outlines (width = 2). With the states layer drawn on top of the us_state_1790 layer, you should now have a good view of how the states and territories of 1790 were carved up into the states we know today.
  9. Zoom in on present-day Kentucky's eastern boundary.

    Turn on the labels for the layers if you wish. They ought to default to the fields with the state/territory names in them.
    You may want to close or hide the Catalog pane to increase the size of the map display area.

    We're about to add a sketch along that eastern boundary to divide the 1790 Virginia polygon into two pieces, shrinking Virginia and creating Kentucky. The accuracy of this edit has nothing to do with the lesson objective, so I encourage you to be as quick-and-dirty as you like especially given the slow performance you'll encounter.

    Speaking of which, let's turn off snapping, as it's likely to only hinder our efforts.
  10. Click the Edit tab, from the Snapping menu, toggle off all snapping.
  11. The easiest way to perform this edit will be to use the Split Tool. Using this tool requires that we first select the polygon we want to cut.

    Turn off the display of the (present-day) states layer for just a moment.
  12. Use the Select tool to select the 1790 Virginia polygon.
  13. Turn the states layer back on. I instructed you to turn it off to avoid selecting features in that layer.
  14. In the Tools button group, activate the Split tool (icon is a line drawn on top of a rectangular polygon).  You may need to scroll down through the editing tools to find it.

    Read through the next two steps, so you know what you are about to do.
  15. Begin your sketch just to the south of where present-day Kentucky, Virginia, and Tennessee come together and add just a few vertices to create a very rough version of Kentucky's eastern border.  To make it easier to differentiate this edit from Moe's coming later, do a particularly sloppy job on this edit. The figure below shows how your sketch might look just prior to completion.

    Screen capture of Cutting with State layer Virginia to create Kentucky prior to completion

  16. To finish the sketch line, double-click just to the north of where present-day Kentucky, Ohio, and West Virginia come together.  It may take a few seconds for the result to appear. Your sketch should produce a smaller Virginia polygon and a new Kentucky polygon, and both should be selected.
  17. Now, click the Attributes button to bring up the attributes of the selected features.
  18. Click on each of the feature entries labeled Virginia at the top of the Attributes dialog, and watch the map to determine which one is actually Kentucky (the western-most of the two new polygons).
    Note, too, that the name Virginia has been inherited in the STATENAM field for the two new features.
  19. Enter Kentucky as the STATENAM value for the correct feature and click Apply.
  20. Save the edit you just made to the Statehood_edits version by clicking the Save button under the Edit tab. 
  21. Save your overall ArcGIS Pro work to a new project named census.aprx - in the Save dialog, be sure to navigate to the Local Disk (D:) drive and save into the data folder.
  22. Close ArcGIS Pro.

B. Perform edits as Moe user

Now you'll play the role of the Moe user. In our scenario, imagine that the census and Moe users didn't coordinate their work very well and Moe thought that creating Kentucky was his responsibility.

  1. Re-open ArcGIS Pro to a new project.
  2. In the Catalog pane, open your Moe_egdb connection.
  3. Drag and drop the us_state_1790 feature class onto the map. Note that Virginia appears in its unaltered 1790 state (i.e., Kentucky does not yet exist). This is because census's changes were isolated from the base us_state_1790 feature class in a separate version. As Moe, you'll now create another new version to isolate Moe's edits from the base feature class.
  4. Following the same procedure outlined above for the census user, create a new version for Moe with these settings:
    • Name: Statehood_changes
    • Owner: Moe
    • Parent Version: dbo.DEFAULT
    • Description: Moe user's statehood changes version
    • Access: Protected
  5. Change to this new version, again following the same procedure you used above.
  6. Now, follow the same Split tool steps you went through as census to create Kentucky from the western part of Virginia.  Sketch the boundary a bit more accurately, though don't go overboard.  Just enough that you'll be able to tell at a glance that it differs from the census user's version.
  7. In addition, our confused Moe is under the impression that the feature class should contain only states (no territories).

    Delete the Northwest Territory (present-day Ohio, Indiana, Illinois, Michigan, and Wisconsin) and the Southwest Territory (present-day Tennessee) polygon features.
  8. Save your edits to Moe's Statehood_changes version.
  9. Save your work to a new project called Moe.aprx and close ArcGIS Pro.

C. How version edits are stored

Now, let's take a look at how the edits you just made are stored in the geodatabase.

  1. Open SQL Server Management Studio.
  2. Navigate to the tables in the egdb database (Databases > egdb > Tables).
  3. Open the SDE_table_registry table -- to do so, you'll need to right-click and choose Select Top 1000 Rows from the context menu -- and find the row for the us_state_1790 table. Make a note of the registration_id for that table. Mine is likely to be different from yours, so I can't say what it should be for you.

    Close the table.
  4. Now, in the egdb Tables listing, locate the 'a#' table and 'D#' table associated with us_state_1790:
    If the registration_id you found in the previous step was 11, for example, the two tables would be named census.a11 and census.D11, respectively. These are the delta tables that were mentioned back in the Introduction.

    The 'a#' table stores features that have been added to the base feature class and the 'D#' table stores features that have been deleted. Why no 'e' table (for edits) you may ask? Features that are edited result in a new row in the 'D' table (recording the deletion of the original feature) and a new row in the 'a' table (recording the new state of the feature — we get to a discussion below regarding 'state').
  5. Open the census.US_STATE_1790 table and note the OBJECTIDs of Virginia (6), Southwest Territory (11) and Northwest Territory (15).
  6. Now, open the 'D#' table and note that it includes rows recording the deletions of the Southwest and Northwest Territories. It also includes two rows associated with deletion of the old version of Virginia (one by each user).
  7. Open the 'a#' table, and note that it includes two pairs of Kentucky/Virginia additions (again, one by each user). The Virginia polygons are the new shapes to replace its old shapes.

When asked to display a version, Esri's software is programmed to start with the parent DEFAULT version of the feature class and incorporate the changes recorded in the delta tables. This process relies on the concept of a feature class state. Every edit made to a feature class version produces a new state with states being tracked using sequential ID values. For example, the first edit to a new version will produce state #1.

The SDE_versions table stores the names and IDs for all of the geodatabase’s versions. It is there that you’ll find the Statehood_edits and Statehood_changes versions created earlier. Other tables used in conjunction with the delta tables to track feature class changes are SDE_states and SDE_state_lineages. The details of how this process works are a bit complicated, so we won’t dig into them. If you’re curious to learn more, you can read through Esri’s Geodatabase system tables in SQL Server documentation page.

D. Switching to another version

It is sometimes necessary to switch the version of the feature class you're currently viewing to some other version you have permission to view. For example, the census user would be able to switch to the DEFAULT version or to the Statehood_changes version (created by Moe).  We already saw how to change to a new version immediately after creating it, but let's drive home the point that the version can be changed later as well.

  1. Back in your remote connection window, re-open your census.aprx project.
  2. Click on the List By Source button in the Display pane. You should see that the us_state_1790 layer is now listed under a heading that says Statehood_edits, indicating that you're viewing that version of the feature class.
  3. Right-click on that heading and select Change Version.
  4. In the Change Version dialog, select the DEFAULT version and click OK. Your map should change to no longer show Kentucky as part of the us_states_1790 layer, since that change is part of the Statehood_edits version and has not been propagated to the DEFAULT version yet.

    You could also switch to the Statehood_changes version, though you would not be able to perform edits on that version since it is owned by Moe and had its permissions set to Protected.
  5. Switch back to the Statehood_edits version before moving on.

E. Viewing version differences

A useful way to inspect changes that exist between two feature class versions is to open the Version Changes view.

  1. Click on the Statehood_edits heading in the Display pane again.  You should see a Versioning tab appear in the ribbon along the top of the application.
  2. Click on the Versioning tab, then on the Version Changes button. This will open a new view labeled Differences alongside the Map view.

    Under the Target Version tab, you'll see DEFAULT listed, since that is the parent version to Statehood_edits.
  3. Click on the Differences tab.  You should see an egdb.census.us_state_1790 heading with 2 in parentheses (indicating the number of differences between the Statehood_edits version and its parent DEFAULT version.
  4. Expand the listing beneath that heading.  Version differences are broken down into Insert, Update, and Delete (in this case, just Insert and Update).
  5. Expand the Insert listing, then click on the one item that appears in the list (representing Kentucky).
    To the right, you should see a column listing properties (attributes), a column that displays the feature's attribute values according to the Current (Statehood_edits) version, and a column that displays the attribute values according to the Target (DEFAULT) version (in this case blank, since this is a feature that's not present in DEFAULT).
  6. Expand the Update listing, then click on the one item that appears in the list. To the right, you should see that the feature with an OBJECTID of 6 in both the Current and Target versions was updated.  (This is the Virginia feature.)
  7. Close the Differences view.
  8. Save your census.aprx project and close ArcGIS Pro.

At some point, you'll want to merge the changes you've made in your isolated version with the base feature class, perhaps after performing a QA/QC check. That's the topic of the next section.