creating and editing vector data - texas a&m university tutorials by... · 1. creating and...

20
Texas A&M University Department of Civil Engineering Creating and Editing Features and Tabular Data Francisco Olivera, Ph.D., P.E. Srikanth Koka Lauren Walker Aishwarya Vijaykumar Department of Civil Engineering Texas A&M University December 5, 2011 Contents Goals of the Exercise ....................................................................................................................... 1 Computer and Data Requirements ................................................................................................. 1 Procedure ........................................................................................................................................ 2 1. Creating and Editing Feature Data ...................................................................................... 2 A. Creating a point shapefile and adding features to it ....................................................... 2 B. Creating a point shapefile using X and Y coordinates ..................................................... 4 C. Creating a line shapefile and adding features ................................................................. 6 D. Creating a polygon shapefile and adding features ........................................................ 13 2. Creating and Editing Tabular Data..................................................................................... 16 A. Creating a dbase table and a personal geodatabase table ........................................... 16 B. Editing tabular data ....................................................................................................... 17 Goals of the Exercise Introduction to: Creating shapefiles and adding features to them Editing existing features Creating tables and adding fields and rows to them Editing existing tabular data Computer and Data Requirements To carry out this exercise, you need a computer that runs ArcGIS 10. You will be working with the following spatial datasets during this exercise. The data can be downloaded and unzipped from the course website: Streams.shp TXCountyInfo.dbf USGSGageStns.dbf

Upload: vanhanh

Post on 01-Jul-2019

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering

Creating and Editing Features and Tabular Data Francisco Olivera, Ph.D., P.E.

Srikanth Koka

Lauren Walker

Aishwarya Vijaykumar

Department of Civil Engineering

Texas A&M University

December 5, 2011

Contents Goals of the Exercise ....................................................................................................................... 1

Computer and Data Requirements ................................................................................................. 1

Procedure ........................................................................................................................................ 2

1. Creating and Editing Feature Data ...................................................................................... 2

A. Creating a point shapefile and adding features to it ....................................................... 2

B. Creating a point shapefile using X and Y coordinates ..................................................... 4

C. Creating a line shapefile and adding features ................................................................. 6

D. Creating a polygon shapefile and adding features ........................................................ 13

2. Creating and Editing Tabular Data ..................................................................................... 16

A. Creating a dbase table and a personal geodatabase table ........................................... 16

B. Editing tabular data ....................................................................................................... 17

Goals of the Exercise

Introduction to:

Creating shapefiles and adding features to them

Editing existing features

Creating tables and adding fields and rows to them

Editing existing tabular data

Computer and Data Requirements

To carry out this exercise, you need a computer that runs ArcGIS 10.

You will be working with the following spatial datasets during this exercise. The data can be

downloaded and unzipped from the course website:

Streams.shp

TXCountyInfo.dbf

USGSGageStns.dbf

Page 2: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 2

Procedure

1. Creating and Editing Feature Data

In this part of the exercise, you are going to create shapefiles and add new features (i.e. points,

lines, and polygons). You will learn how to start editing, how to sketch using the construction

tools, how to snap features, and how to change the shapes of the features.

Before starting this exercise, create a working folder and name it “EditData.” You will use this

folder to store the results obtained during the execution of this exercise.

A. Creating a point shapefile and adding features to it

(1) You will now create a point shapefile and add features to it. Open ArcCatalog from the

Windows Start menu. Browse down to your working folder, right-click on it, and then

click on New/Shapefile.

(2) In the box that appears, enter NewPt for Name making make sure that Point is chosen

for Feature Type, and then click OK.

Page 3: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 3

(3) You will add some points in this shapefile. In order to do this you will have to add the

shapefile you have created to an ArcMap document. Open a new empty map file in

ArcMap.

(4) Once the ArcMap document is opened, add the NewPt shapefile by using the Add

Data tool. If a warning message appears, click OK to continue. To start adding point

features to this shapefile, you should start editing.

(5) Open the Editor toolbar, by clicking on Customize/Toolbars/Editor.

(6) To start editing, click on Editor/Start Editing. You will see that the tools and drop

down lists are activated in the Editor toolbar, that a Create Features dialog opens, and

that NewPt is an entry in the Create Features dialog.

(7) You will add features to this shapefile using the tools under Construction Tools. Click

on the Point tool and then start clicking wherever you want on the map display.

(8) Once you have finished adding features, the next step is to save the edits. To do this,

click on Editor/Save Edits. To stop editing completely, you will have had to click

Editor/Stop Editing.

(9) To move points from their positions, you will need to start editing again using

Editor/Start Editing. Click on the Edit Vertices tool . To move a point, click on the

point, and once the cursor changes, drag it where you want. Repeat this procedure for

several points. Once you have moved points, stop editing by clicking on Editor/Stop

Editing. Save edits if asked to do so.

Page 4: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 4

B. Creating a point shapefile using X and Y coordinates

When X and Y coordinates of points are given, creation of a dataset containing the

corresponding features can be automated using the Add XY data tool. For this section, you

will need to use the downloaded data or continue using the same document from Part 1A.

(1) Using Add Data tool, add USGSGageStns.dbf to the map. This dbf file contains latitude

and longitude information for all USGS gauging stations. Other information included is

the station name, the station number, the website URL for the stations, and the HUC

ID.

(2) You can observe this information by right clicking on the file and selecting Open. You

will use the latitude and longitude fields to create a new shapefile that will contain

corresponding USGS gauging stations as points. Close the Attributes Table.

(3) In ArcCatalog, click Data Management Tools/Layers and Table Views/Make XY Event

Layer. In the wizard that appears, select USGSGageStns as the XY Table, LONDD for X

Field and LATDD for Y Field. Click OK

Page 5: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 5

(4) A shapefile is created containing points with coordinates taken from the

USGSGageStns.dbf table.

Page 6: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 6

C. Creating a line shapefile and adding features

a. Creating a line shapefile

(1) You will create a line shapefile and add features to it in this part of the tutorial.

Using ArcCatalog, browse down to your working folder, right-click on it, and then

click on New/Shapefile.

(2) In the wizard that appears, enter NewLine for Name, make sure that Polyline is

chosen for Feature Type, and click OK.

b. Drawing lines

(1) You will now add lines to this shapefile. In order to do this, you will have to add the

shapefile you have created to an ArcMap document. To start drawing lines to the

new layer, you need to start editing. Open the Editor toolbar, by clicking on

Customize/Toolbars/Editor.

(2) To start editing, click on Editor/Start Editing. You will see that the tools and drop

down lists are activated in the Editor toolbar, that a Create Features dialog opens,

and that NewLine is an entry in the Create Features dialog.

(3) You will add features to this shapefile using the tools under Construction Tools.

Click on the NewLine label in the Create Features dialog and then the Line tool

under Construction Tools and draw a line as shown in the figure below. After

drawing the last segment, double-click to stop drawing.

Page 7: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 7

(4) Once you have finished constructing the shapefile, the next step is to save the edits.

Do this by clicking on Editor/Save Edits. Note that as you are going to edit this layer,

you will save the edits rather than stop editing. Remember that the line layer has

only one line feature up to this point.

c. Splitting lines

The next step is to split the line feature in your layer into two features. You can split the

feature manually (do not perform this now, but test it later as you are going to do this

automatically) by first selecting the feature using the Edit Tool, then clicking on the Split

Tool located on the Editor Toolbar and finally clicking on the line where you would like

it split.

The automatic way of splitting is by specifying the split distance as a length or as a

percentage.

(1) First, select the feature using the Edit Tool and then click Editor/Split. A window

appears where you should choose Percentage as the option for Split an enter 50 in

the text box.

(2) Let From Start Point of Line be selected for Orientation and click OK. To save the

edits, click on Editor/Save Edits. Once this is done, the feature you have selected

will be split into two new features. You should not be able to see the features split

clearly on the map, but you can see that in the attribute table the number of rows

has increased to two.

(3)

Page 8: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 8

(4) Open the attribute table and select the two rows separately. Observe the

corresponding features being selected on the map. Do not stop editing yet because

you are going to do more editing operations. If you have stopped editing, start

editing by clicking on Editor/Start Editing.

d. Merging lines

The next step is to merge the lines you have split into one feature. You can merge

features using the Merge Tool.

(1) First, select the features to be merged by holding shift and clicking on both sections

of the split line. Then go to Edit Tools and click on Editor/Merge. Select OK in the

Merge Window that appears. You can now stop editing by clicking on Editor/Stop

Editing.

Page 9: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 9

(2) The two features you have selected should now be merged into one feature. You

cannot see the features merged clearly on the map, but you can see that the

number of rows in the attribute table has decreased from two to one. Open the

attribute table and select the one row. Observe the corresponding feature being

selected on the map.

(3) Another similar tool is the Union Tool. This merges the features instead of replacing

them, which creates a new feature. The newly created feature will coincide with the

features that were involved in the union. For example, after unioning an object, you

can relocate it to a new location and the original object will remain in the original

place. Though you may skip union for this exercise, you can do it by selecting the

features first, then clicking on Editor/Union.

e. Snapping lines

Snapping is used to move a feature to a precise location in relation to another feature.

In this part of the exercise, you are going to move a line so that its end (To-node)

coincides with start of another line (i.e., From-node).

For this exercise, you are going to use the stream network of the Bull Creek watershed

located near Austin, Texas. In a stream network, all lines are connected. It has been

observed, in this shapefile, that a line (bearing attribute value of FID=17) is disconnected

from the network in which you will connect to its downstream line.

(1) Open a new ArcMap document. To the data frame in this document, add the

Streams.shp from the downloaded data as a layer using the Add Data tool.

Page 10: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 10

(2) To see each line with a different color, change the layer’s symbology to Unique

values. Do this by right clicking on the streams layer. In the drop down menu, click

on Properties.

(3) The Layer Properties wizard opens. In this wizard, select the Symbology tab and

click Categories/Unique values in the Show: list box. Click on the Add All Values

button and finally click OK to change the symbology.

(4) Now open the attribute table of this layer by right clicking on the layer and then

clicking Open Attribute Table in the drop down menu.

(5) Move down in the table until you see the row containing a value of 17 in the FID

field. Select this feature to see where it is located and zoom to the junction where

this line meets the next line (which is downstream to it) using the Zoom In tool. If

you zoom in enough you will see that this line is not connected to the network.

Page 11: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 11

(6) To correct this error you can move the line towards the downstream line, but they

may not coincide exactly at the junction. To move the line perfectly, you must use

the snapping feature. Start editing by clicking on Editor/Start Editing. Select the

unconnected segment if it is not already selected.

(7) Next, you will set the snapping environment. Click Editor/Snapping/Snapping

Toolbar. In this toolbar, ensure that the End Snapping button is selected.

(8) Using the Edit Tool , double-click on the line so that the vertices are visible as

shown below in the first image. Observe that the vertex in red is the To-node of the

line. Drag this To-node towards the junction.

Page 12: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 12

(9) Once you have done this, you can and stop editing and save, by clicking on

Editor/Stop Editing. You can zoom closer to see that they are now perfectly

connected.

Page 13: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 13

D. Creating a polygon shapefile and adding features

a. Creating a polygon shapefile

(1) You will now create a polygon shapefile and add features to it. In ArcCatalog,

browse down to your working folder and right-click on it.

(2) Click on New/Shapefile. In the wizard that appears, enter NewPGon for Name,

make sure that Polygon is chosen for Feature Type, and click OK.

b. Drawing polygons

(1) Add the newly created shapefile to ArcMap using the Add Data tool. Click OK if

necessary in the warning box.

(2) To start drawing lines to the new layer, you need to start editing. Open the Editor

toolbar, by clicking on Customize/Toolbars/Editor.

(3) To start editing, click on Editor/Start Editing. You will see that the tools and drop

down lists are activated in the Editor toolbar, that a Create Features dialog opens,

and that NewPGon is an entry in the Create Features dialog.

(4) You will add features to this shapefile using the tools under Construction Tools.

Click on the NewPGon label in the Create Features dialog and then the Polygon tool

under Construction Tools. Draw 3 or 4 polygons of any shape in the map display.

Double-click in place to end the drawing of each polygon.

Page 14: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 14

(5) Click on Editor/Save Edits. It is not necessary to select Stop Editing because you will

continue to edit this layer.

c. Cut polygons

(1) The next step is to cut a polygon into two. First, select the feature you want to cut

using the Edit Tool.

(2) In the Editor toolbar, click the Cut Polygons tool . Then, draw a line across the

polygon as shown in the figure below. Double-click in place to end the line.

Page 15: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 15

(3) To save these edits, click on Editor/Stop Editing. You can now see that the polygon

feature is cut into 2 polygons. In the next part of the exercise, you will merge these

two features back into one feature again.

d. Merging polygons

(1) You can merge the polygon features using the Merge Tool. Before going into

merging polygons make sure that no features are selected. If some are, then clear

the selection by clicking on Selection/Clear selected features.

(2) Start editing by going to Editor/Start Editing in the Edit Toolbar. Select the two

features that resulted due to the cut polygon operation done previously by using

the Edit Tool by pressing shift. Click on Editor/Merge and select OK in the Merge

box if necessary.

(3) You can stop editing by clicking on Editor/Stop Editing. Two features you selected

are now merged into one feature.

(4) Another similar tool is the Union tool. This merges the features instead of replacing

them, which creates a new feature. The newly created feature will coincide with the

features that were involved in the union. For example, after unioning an object, you

can relocate it to a new location and the original object will remain in the original

place. Though you may skip union for this exercise, you can do it by selecting the

features first, then clicking on Editor/Union.

Page 16: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 16

2. Creating and Editing Tabular Data

A. Creating a dbase table and a personal geodatabase table

In this part of the exercise, you will create a dbase table and add a field and a row to it.

(1) In ArcCatalog, right-click on your working folder and then click New/dBase Table.

(2) Change the name of the table from the default to NewTab. Preview the table by

selecting the Preview tab. Note that the table has two fields – one by the name OID

and the other by the name Field1.

(3) You will now add a new field to this table. In the lower part of the table, click

Options/Add Field. In the wizard that opens, enter NewFld as Name: Long Integer as

Type: and then click OK to add the field. To add rows to this table you will have to start

editing, which is the next part of the exercise.

Page 17: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 17

B. Editing tabular data

In this part of the exercise, you will correct field values, add a field, and use a map calculator

to populate it.

(1) In a new empty ArcMap document, add the table named TXCountyInfo.dbf from the

downloaded data to the table using the Add Data tool. If the table name is not visible

in the Table of Contents, change the view from Display to Source in the table of

contents . Once the table is made visible, right-click on it and click Open to open the

table.

(2) In this table, you will see the following fields: OID, NAME, POPULATION, and

AREA_SQ_MI. These fields are self-explanatory by the names. The value ARMSTRONG

is misspelled as AMSTRONG for the NAME field in a row. You need to change the

corresponding row value. Arrange the entries of the NAME field in ascending order by

right clicking on the NAME field and then clicking on Sort Ascending in the drop down.

(3) Scroll down the table until you find AMSTRONG in one of the rows for the NAME field

and start editing by clicking Editor/Start Editing.

Page 18: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 18

(4) Now click on AMSTRONG, delete, and type ARMSTRONG. Once you have done this,

stop editing by clicking on Editor/Stop Editing. In the message box, click Yes for Do

you want to save changes.

(5) You will add a new field to this table and populate it with population density using

the population and area values given in the other fields. To add a new field, click

on Options/Add Field at the bottom of the table.

(6) In the wizard that opens, enter POP_DENS for Name:, select Float for Type: and

click OK. To populate this field with population density values, right-click on this

new field name and then click on Field Calculator.

Page 19: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 19

(7) The Field Calculator wizard should open. Click in the text box of the wizard so that

the cursor lies inside it. Then double click on POPULATION in the Fields text box,

click / sign and double click on AREA_SQ_MI in the Fields text box. Use all other

default options and then finally click OK to populate the population density field.

Page 20: Creating and Editing Vector data - Texas A&M University Tutorials by... · 1. Creating and Editing Feature Data In this part of the exercise, you are going to create shapefiles and

Texas A&M University

Department of Civil Engineering 20

These materials may be used for research and educational purposes only. Please credit the

authors and the Department of Civil Engineering, Texas A&M University.

All commercial rights reserved. Copyright 2011: Texas A&M University.