30
Texas A&M University 1 Department of Civil Engineering Map Analysis with Vector Data Francisco Olivera, Ph.D., P.E. Srikanth Koka Lauren Walker Aishwarya Vijaykumar Keri Clary Department of Civil Engineering Texas A&M University April 21, 2014 Contents Brief Overview of Map Analysis ...................................................................................................... 2 Goals of the Exercise ....................................................................................................................... 2 Computer and Data Requirements ................................................................................................. 2 Procedure ........................................................................................................................................ 3 1. Selecting Features ............................................................................................................... 3 A. Selecting features manually ........................................................................................ 3 B. Selecting features by attributes ...................................................................................... 5 C. Selecting features by location ......................................................................................... 7 2. GeoProcessing Wizard ......................................................................................................... 9 A. Dissolve features ......................................................................................................... 9 B. Merge layers .................................................................................................................. 12 C. Clip layers ...................................................................................................................... 14 D. Intersect layers .......................................................................................................... 16 E. Union layers ................................................................................................................... 17 3. Tabular Analysis ................................................................................................................. 19 A. Joining tables ............................................................................................................. 19 B. Relating tables ............................................................................................................... 21 C. Attribute statistics ......................................................................................................... 24 D. Summarizing tables ................................................................................................... 25

Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

  • Upload
    lamliem

  • View
    216

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University 1 Department of Civil Engineering

Map Analysis with Vector Data

Francisco Olivera, Ph.D., P.E. Srikanth Koka Lauren Walker

Aishwarya Vijaykumar Keri Clary

Department of Civil Engineering Texas A&M University

April 21, 2014

Contents Brief Overview of Map Analysis ...................................................................................................... 2

Goals of the Exercise ....................................................................................................................... 2

Computer and Data Requirements ................................................................................................. 2

Procedure ........................................................................................................................................ 3

1. Selecting Features ............................................................................................................... 3

A. Selecting features manually ........................................................................................ 3

B. Selecting features by attributes ...................................................................................... 5

C. Selecting features by location ......................................................................................... 7

2. GeoProcessing Wizard ......................................................................................................... 9

A. Dissolve features ......................................................................................................... 9

B. Merge layers .................................................................................................................. 12

C. Clip layers ...................................................................................................................... 14

D. Intersect layers .......................................................................................................... 16

E. Union layers ................................................................................................................... 17

3. Tabular Analysis ................................................................................................................. 19

A. Joining tables ............................................................................................................. 19

B. Relating tables ............................................................................................................... 21

C. Attribute statistics ......................................................................................................... 24

D. Summarizing tables ................................................................................................... 25

Page 2: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 2

4. Spatial Join ......................................................................................................................... 27

5. Buffers ............................................................................................................................... 29

Brief Overview of Map Analysis Map analysis involves inferring information necessary for engineering and scientific tasks from the general information contained in digital spatial datasets. In this exercise, analysis will be performed using vector data (points, lines, and polygons).

Goals of the Exercise This exercise introduces you to the following:

• Selecting features • Geoprocessing tools • Tabular analysis • Spatial join • Buffers

Computer and Data Requirements To perform this exercise, you need a computer that runs ArcGIS 10.2. The data required for this exercise is available on the class website. During this exercise, you will work with the following spatial datasets contained in three different folders: Main Folder: VectorAnalysis

Folder 1: SelectFeats texas_counties.shp contains the county features texas_rivers.shp contains the river features Texas_roads.shp contains the road features Folder2: GeoWizard TXCounties.shp and TXAquifers.shp are polygon datasets TXRoads.shp is a line dataset Hr_Precip.shp and 15min_Precip.shp are point datasets

Page 3: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 3

In addition to geometric information (area, perimeter, and length), the feature classes have the following fields: Intensive Attributes Extensive Attributes

TXCounties: County name TXAquifers: Aquifer name TXRoads: Road name HrPrecip: Hourly precipitation depth (1/100 in) 15minPrecip: Quarter-hour precipitation depth (1/100 in)

TXAquifers: groundwater storage

Folder3: TabAnal CityInfo.dbf is a dbf table that contains population information for cities in Texas TX_Cities.shp is a point shapefile that contains the cities of Texas TX_counties.shp is a polygon shapefile that contains the counties of Texas

Procedure 1. Selecting Features A. Selecting features manually In this section of the exercise, you will learn how to select features manually.

(1) Open ArcMap 10.2. (2) Add the texas_counties, texas_rivers, and Texas_roads shapefiles (located in the

SelectFeats folder) to the data frame using the Add Data tool . Save the map document with a name of your choice. You will now select features from the texas_counties layer only. In order to select features from this layer only, you have to make the layer the only selectable layer.

(3) First, make the Texas_roads and texas_rivers layers invisible. Right click on the texas_counties layer, and then click Selection/Make This The Only Selectable Layer. Alternatively, click on the List by Selection button in the Table of Contents pane

. Then, Click on the Click to toggle selectable button next to the texas_rivers and Texas_roads labels.

Page 4: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 4

(4) Click on Selection/Selection Options. Under Selection Tools Settings, change the

selection color from blue to red and click OK.

(5) Now you have chosen the layer you want to select features from, and a color for the

selection. Make sure that the Tools toolbar containing the Select tool is displayed in ArcMap. If it is not visible, click Customize/Toolbars/Tools on the main menu.

(6) To select only one feature, click on the Select Features tool and then click on the feature you want to select. To select multiple features press and hold the Shift key, and then using the Select tool, click on all the features you want to select.

(7) You can now toggle the selection by right clicking on the texas_counties layer, pointing

to Selection and clicking on Switch Selection. (8) To clear the selections, click on Selection/Clear Selected Features. You can also do

this using Clear Selected Features button on the Tools toolbar.

Page 5: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 5

B. Selecting features by attributes Manual selection is useful when you know the locations of the features you want to select. However, if you have other information about an attribute such as the names of the counties, you can use this information and define a query to select the features automatically.

In this section of the exercise, you will select the county features whose names are Brazos, Carson, Parker, Reeves, and Refugio using the Select by attributes tool.

1) Click on Selection/Select by Attributes. In the wizard that opens, choose texas_counties for Layer, and Create a new selection for the Method.

2) To build the query, use the query window, which is titled “SELECT * FROM

texas_counties WHERE:” You can type a query if you want, but this could lead to errors; inserting a query by clicking on the buttons provided for building queries is better.

3) In the fields box, double-click on COUNTY_NAM. Now click on the equals (=) button and

in the Unique values list, browse down to Brazos and double-click it.

4) You should see a statement that says “COUNTY_NAM” = ‘Brazos.’ As it stands, your query can select only one feature. To select all the other counties, create statements like that described above, each separated by OR.

Page 6: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 6

5) To add the next statement, click the OR button and then double-click on COUNTY_NAM.

Click on the equals (=) button and in the Unique values list, browse down to Carson and double-click it. Repeat this step for all the other three counties and your final query should look like "COUNTY_NAM" = 'Brazos' OR "COUNTY_NAM" = 'Carson' OR "COUNTY_NAM" = 'Parker' OR "COUNTY_NAM" = 'Reeves' OR "COUNTY_NAM" = 'Refugio'.

6) Click Apply to select the features and click Close to close the wizard.

Page 7: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 7

Look at the selected features on the map. Do not clear or alter the selection; it will be used in the next part of the exercise. C. Selecting features by location In this part of the exercise, you will select features based on location by following the directions below.

(1) Make the Texas_roads and texas_rivers layers visible. You will select the roads that

share the same spatial location as the selected counties, i.e., in other words, you will select the roads and rivers that are contained by the selected counties.

(2) Do this by clicking Selection/Select by Location. A dialog titled Select by Location

opens. In the dialog, keep “select features from” as the option for Selection method: (3) Choose Texas_roads and texas_rivers as the Target layers and texas_counties as the

Source layer. For the Spatial selection method, choose Target layer(s) features intersect the Source layer features. Make sure the Use selected features option is selected. Then, click Apply.

Page 8: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 8

(4) Close the wizard and make the texas_counties layer invisible so that you can look at

the selected features from the other two layers clearly.

Page 9: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 9

2. GeoProcessing Wizard To learn how to use the GeoProcessing tools, you will use the data in the GeoWizard folder. The five feature classes used in this exercise are:

TXCounties.shp and TXAquifers.shp, which are polygon datasets TXRoads.shp, which is a line dataset, and Hr_Precip.shp and 15min_Precip.shp, which are point datasets

A. Dissolve features The Dissolve function creates a new feature class/shapefile in which all features that have the same value for a given attribute are aggregated into a single record. It can be applied to only one dataset at a time; the user has the option of defining how attributes are recalculated. Before going into the details on how to use the GeoProcessing tools, add TXCounties.shp, TXAquifers.shp, TXRoads.shp, Hr_Precip.shp, and 15min_Precip.shp from the GeoWizard folder to a new ArcMap document and save the document.

TXAquifers.shp defines the different aquifers within the state of Texas. Make all the layers invisible except TXAquifers.shp. Right-click on TXAquifers-layer and select Label Features. Notice that aquifers such as Seyour and Trinity have many separate parts. In order to dissolve all parts of an aquifer into a single record for that aquifer, you will have to use the dissolve function under the geoprocessing wizard. Do this by following the directions below.

Page 10: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 10

(1) Click on ArcToolbox and select Data Management Tools/Generalization/Dissolve.

(2) In the wizard that opens, select TXAquifers under Input Features, select AQ_NAME

under Dissolve Field(s), choose the working folder, and enter TXAquif_DISS as the name for the output under Output Feature Class. Click OK.

Page 11: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 11

(4) Open the attribute tables of TXAquifers and TXAquif_DISS, and note that the number of polygons has decreased from 139 to 9 by comparing records in the attribute tables of TXAquifers.shp and TXAquif_DISS.shp. After dissolving the dataset, the key attribute (i.e., AQ_NAME) is copied.

You should see that in the attribute table of TXAquifers, the Seymour aquifer has 25 rows. In the attribute table for TXAquif_DISS, it only has one. Select the Seymour aquifer row in TXAquifers and note that all polygons in the Seymour aquifer are selected.

Page 12: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 12

B. Merge layers The Merge function creates a new feature class or shapefile from features of two or more feature classes or shapefiles, attributes of only one of the feature classes or shapefiles are retained, and attributes of the other feature classes or shapefiles are retained only if they have the same name. The user has the option of selecting the dataset whose attributes will be retained.

(1) Make all layers invisible except Hr_Precip and 15min_Precip. Change the symbology of

these layers before merging them. Change the symbol of layer Hr_Precip to the type called “Square2.”

(2) This can be done by left clicking on the layer symbol in the Table of Contents and

choosing Square2 under Symbol in the Symbol Selector.

(3) Similarly, change the symbol of layer 15min_Precip to the type called “Circle 2.” You then need to right-click on the layer 15min_Precip and go to Data/Export Data. Make sure that the option All features is selected next to Export and that you Use the same coordinate system as the layer’s source data. Name the layer Merge and save as a shape file. Click yes to add the layer to the map.

Page 13: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 13

(4) You will now merge Hr_Precip.shp and 15min_Precip.shp so that all the precipitation stations are in the same dataset. Do this by clicking on ArcToolbox/Data Management Tools/General/Append. Under Input Datasets click the drop down box, select the layer Hr_Precip, and in the Target Dataset select the layer Merge. Select NO TEST under Schema Type. Click OK. The layers will now be merged.

Page 14: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 14

C. Clip layers

The Clip function creates a new feature class by clipping an input feature class with another clipping polygon feature class. The attributes of the input feature class are not altered (including the geometry). In this exercise, you are going to clip road features from TXRoads.shp using selected features of TXAquif_DISS. Before going into the process of clipping: (1) Select the Trinity aquifer in the attribute table of TXAquif_DISS. (2) In the field named AQ_NAME find Trinity and select the record by clicking on the box

located on the left most part of the record.

(3) In the Table of Contents, change the order of the layers so that TXRoads is above TXAquif_DISS. Make all the layers invisible except TXRoads and TXAquif_DISS.

(4) You then need to export the selected features. Right click on the TXAquif_DISS click

on Data/Export Data. Make sure Selected features is chosen next to Export and name the layer TrinityExport. Click OK.

You are now ready to begin clipping the data: (5) Click on ArcToolbox/Analysis Tools/Extract/Clip. (6) Select TXRoads as the option for Input Features, choose TrinityExport for Clip

Features, enter the name for new clip shapefile as TXRoads_CLIP and click OK.

Page 15: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 15

(7) A new layer will be added to the data frame. To see features of only the new layer

make all layers invisible except TXRoads_CLIP.

Page 16: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 16

D. Intersect layers

The Intersect function creates a new feature class/shapefile in which the features are the result of intersecting the features of an input feature class/shapefile with the polygons of an overlay feature class/shapefile. Resulting features have attributes from both feature classes/shapefiles. In this part of the exercise, you will be intersecting TXCounties (input) and TXAquifers (overlay) so that for each resulting polygon, the population density per unit area and the underlying aquifer are a unique combination of values. (1) In ArcMap, make only layers TXCounties and TXAquifers visible. If the layers have the

same symbol color, change the color so that they can be distinguished. Now you will intersect the layers.

(2) Click on the ArcToolbox/Analysis Tools/Overlay/Intersect. (3) Select TXCounties and TXAquifers layers as the Input Features and name the Output

Feature Class shapefile as “Cty_Aq_INTERSECT.” Click OK and a new layer will be added to the data frame.

Page 17: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 17

E. Union layers

The Union function creates a new feature class/shapefile by combining the polygons of an input feature class/shapefile with the polygons of an overlay feature class/shapefile. The resulting dataset has the extent of both. Only two polygon datasets can participate in a union at a one time. Union is very similar to Intersect, but in Union the parts of the polygons that do not intersect have a value of zero for the non-defined attributes. In this part of the exercise, you will union TXCounties (input) and TXAquifers (overlay), so that for each resulting polygon, the population density per unit area and the underlying aquifer are a unique combination of values. (1) In ArcMap, make only layers TXCounties and TXAquifers visible. If the layers have the

same symbol color, change the color so they can be distinguished. You will now union the layers.

(2) Click on the ArcToolbox/Analysis Tools/Overlay/Union.

Page 18: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 18

(3) Then select TXCounties and TXAquifers under Input Features and name the shapefile “Cty_Aq_UNION” Click OK. A new layer will be added to the data frame.

Save the ArcMap file. Keep this tutorial open; you will use it for the next section of this exercise.

Page 19: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 19

3. Tabular Analysis A. Joining tables Joining tables involves appending the attributes of a source table to a target table, where the records are related through key fields in each table. The tables do not necessarily have to be attribute tables.

In this part of the exercise, you will join an attribute table (shapefile) to a stand-alone table. Here, we will use the TX_Cities shapefile and the CityInfo table containing population information of the cities. Both files are located in the TableAnal folder.

(1) Open a new ArcMap document by selecting the new file icon in the toolbar . To the data frame in the new ArcMap document, add TX_cities.shp and CityInfo.dbf from the TabAnal folder using the Add Data tool. If the table is not visible in the Table of

Contents, change the view to List by Source . (2) Open the attribute table of the TX_Cities shapefile and open the CityInfo table. You

should observe that the cities shapefile has 3 fields: FID, Shape*, and CITYNAME. The CityInfo table has 6 fields: OID, CITY_NAME, COUNTY, SIZE, POP_2000 and POP_1990. Here, population is given in thousands. You will now join the fields of the CityInfo table to the TX_Cities shapefile using the key fields (i.e., CITYNAME from shapefile and CITY_NAME from the table).

(3) Close the tables and then right-click on the TX_cities layer, point to Joins and Relates,

click on Join. In the Join Data window that appears, choose ‘Join attributes from a table’ for What do you want to join to this layer?, select CITYNAME for Choose the field in this layer that the join will be based on, select CityInfo in the next dropdown, insert a check mark for Show the attribute tables of layer in this list, choose CITY_NAME for Choose the field in the table to base the join on, and click OK. (Click No for Create Index if a warning dialog pops up.)

Page 20: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 20

(4) To see the join, open the attribute table of the TX_Cities layer. You will see that the number of fields has increased. The join is temporary; it will vanish if you close the ArcMap document without saving it.

(5) To make the join permanent, export the shapefile as a new shapefile by right clicking

on the TX_Cities layer, pointing to Data and then clicking on Export data.

Page 21: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 21

(6) Choose to export All Features and Use the same coordinate system as this layer’s

source data. Select the folder and enter a name for the new shapefile. Click OK and Yes to add exported data to the map as a layer.

(7) You can now remove the join, by right clicking on the TX_Cities layer, pointing to Joins

and Relates/ Remove join(s)/CityInfo. If you open the attribute table of TX_Cities layer, you will see that original table has been restored.

For the next part of the exercise, keep this document open.

B. Relating tables In the case of a one-to-many relation, joining tables is not a recommended option as one of the many records will be randomly picked for the join; relating tables is the solution to this scenario. Relating tables involves relating the records of a source table to the records of a target table through key fields defined for each of the two tables. For example, as a county can have more than one city, it is better to relate them rather than join them.

(1) Add the TX_counties shapefile from the TabAnal folder using the Add Data tool to the

data frame in the ArcMap document. (2) Make sure that the new Join layer is above the counties layer in the Table of Contents.

You will now relate the fields of the counties layer to the newly exported and created shapefile using the key fields (i.e., NAME_LOCAS from the TX_counties shapefile and COUNTY from the Join shapefile).

(3) Right-click on the TX_counties layer, point to Joins and Relates, click on Relate. In the

form that opens, select NAME_LOCAS for Choose the field in this layer that the relate will be based on, select the Join layer in the next dropdown menu, choose COUNTY for Choose the field in the related table or layer to base the relate on:, let “Relate1” be the name for the relation and click OK.

Page 22: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 22

(4) To see how the relate works, open the attribute table of TX_counties by right clicking on the layer and then clicking on Open Attribute Table. In the TX_counties attribute table, select any record you want by clicking on the box located on the left-most side of a record.

(5) At the bottom on the table, click Show selected records , and then click Options/Related Tables/Relate1: Join. The CityInfo table opens up in which the related rows are selected.

Page 23: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 23

(6) You can also see the selected features on the map by closing the attribute tables. Keep this document open as you will be using it for the next section of the exercise.

Page 24: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 24

C. Attribute statistics The statistics of the attributes of selected records for a given field are obtained using the Statistics function.

(1) Clear all selected features from the ArcMap document using Selection/Clear selected

features. (2) Make the TX_Counties layer invisible so that you can see only the point features of the

Join layer. Open the attribute table of the Join layer by right clicking on it and then clicking on Open Attribute Table.

(3) Select 5 to 7 records of your choice in the attribute table. After selecting the records,

right-click on the field name POP_2000 and then click on Statistics. Look at the frequency distribution and then close the statistics window and table.

Page 25: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 25

D. Summarizing tables Summarizing tables involves aggregating all the records that have the same value for a user-defined key field into a single record. The values of other fields are aggregated based on user-defined options.

For this part of the exercise, you will again use the Join layer.

(1) Before going further, clear all selected features from the map by clicking on

Selection/Clear selected features. (2) You will now summarize the SIZE field. This field contains 6 different values,

Community, Large City, Large Town, Major City, Small City, and Town, which are all based on city population values. Using the Summarize function, you will obtain a table that gives the city count for each type.

(3) Open the attribute table of the Join layer if it is not already open by right clicking on it

and then clicking on Open Attribute Table. (4) Find the SIZE field in the table. Right-click on this field and then click on Summarize.

Using all the default options in the wizard that opens, specify the output file name as “OutTable” and the filetype as “dBase Table.”

Page 26: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 26

(5) Click OK. Click Yes to add the new dbf table to the map. Open the dbf table and see

the fields SIZE and count_SIZE.

Page 27: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 27

4. Spatial Join The Spatial Join function appends the attributes of a record of a source feature class/shapefile to a record of a target feature class/shapefile with which it shares the same location and creates a new feature class/shapefile. In this part of the exercise, you are going to spatially join a shapefile with another. You will again use the TX_cities and TX_Counties shapefiles. (Note: First, you must make sure that both layers have a defined projection. Open ArcCatalog and browse to the shapefiles. Right click on each shapefile, go to Properties/XY Coordinate System. You will see that TX_Counties does not have a projection defined. Click on the Add

Coordinate System button . Click Import and browse to TX_Cities. Select the TX_Cities shapefile, click Add, and then Apply. Now remove TX_Counties from the ArcMap document by right clicking on it in the Table of Contents and then Remove. Add the TX_Counties shapefile back to the ArcMap document. Now, proceed with the steps below to perform a spatial join.)

(1) If there are any features selected in the ArcMap document, clear them by clicking on Selection/Clear selected features. In this part of the exercise, you will join the TX_Cities layer with the TX_counites layer based on an “Inside” relation, i.e., joining cities point features with the county polygons in which they lay.

(2) Make both layers visible then right-click on the TX_cities layer, point to Joins and

Relates, and click on Join. (3) In the form that opens, choose “Join data from another layer based on spatial

location” for What do you want to join to this layer?, select TX_counties for Choose the layer to join to this layer, or load spatial data from disk, select the option it falls inside, choose the working folder for the output shapefile and enter the name “SpatialJoin.”

Page 28: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 28

(4) Click OK. A new layer is added to the data frame that contains features belonging to

TX_Cities, but the number of fields increases, as the fields from both TX_Cities and TX_counties are included. Open the attribute tables of the new layer and TX_Cities so that you can observe the increase in number of fields.

Page 29: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 29

5. Buffers The Buffer function creates a polygon graphic or a new polygon feature class in which the outlines are at a given distance from buffered graphics or features of a feature class/shapefile. This applies to one feature class only. Buffers can be created in three different ways: single area at a given distance, single area at a distance defined in an attribute of the buffered features, or multiple areas at distances multiple of a given value. Make only the TXRoads_CLIP layer visible. You will now create a multiple (3) buffer of 1 km around the roads.

(1) In the map, click on ArcToolbox/Analysis Tools/Proximity/Multiple Ring Buffer. (2) For the Input Features, select the TXRoads_CLIP shapefile; for the Output Feature

Class, type BUFFER; click Save. Under distance, enter 1, then click the Plus sign, then 2, then click the Plus sign, and then 3, and then click the plus sign. In Buffer Units, click on Kilometers and make sure the Dissolve Option/All is selected. Click OK.

(3) A new layer is added to the data frame, which contains the buffered features. Look at

its attribute table by right clicking on the new layer, and then clicking on Open Attribute Table.

Page 30: Map Analysis with Vector Data - Texas A&M University · PDF fileinserting a query by clicking on the buttons provided for building queries is better. 3) ... option is selected. Then,

Texas A&M University Department of Civil Engineering 30

Move the layer TXRoads_CLIP on top of the Buffer layer and zoom in to get a better idea of the results.

Precipitation data source: National Climatic Data Center Staff, National Climatic Data Center, National Oceanic and Atmospheric Administration. Climate Data Online Database for Texas. Available URL: “http://www.ncdc.noaa.gov/cdo-web/datasets” [Accessed 8/13/2014].

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 2014: Texas A&M University.