MAST 10

Created on 2/14/2007 9:52:00 AM

Selecting features and creating a .lyr file or new data file

Data queries are an important part of exploring and preparing GIS data for a project. ArcMap provides several methods of querying (selecting) features. Selections can be classified into two categories, attribute (table) queries and location (spatial queries).

Select features with from the attribute table -

  1. By performing an attribute query, this can be done from the Selection menu and choosing “Select by Attribute” or when an attribute table is open press the Option button and then choose “Select by Attribute”
  2. By opening up the layer properties and selecting “Definition query” [A definition query resembles an attribute query in that your write an expression to find features with a particular attribute. The difference is that features satisfying an attribute query are selected, while features satisfying a definition query are displayed and the rest are hidden.]

Select features spatially -

  1. By manually selecting them using the Select Features tool
  2. By selecting features by location. Four different spatial relationships can be used to perform a location query: distance, containment, intersection, and adjacency (ArcGIS defines eleven spatial relationships, each one a variation on one of the four types.)

Chapter 8: Querying data

8a: Identifying, selecting, finding, and hyperlinking features

·  Zoom to layer

·  Identify tool

·  Set selectable layers

·  Selection Options

·  Select features tool

·  Open attribute table

·  Showing the selected records

·  Sorting the fields of tables

·  Clearing selected features*** make a mental note of this!

·  Creating Hyperlinks – 2 ways

·  Find tool

8b: Selecting features by location

·  Structured Query Language (SQL)

·  Select by attribute

Chapter 10: Selecting features by location

10a: Select by location

10b: Combining attribute and location queries

·  Add data button

·  Definition Query

·  Spatial Join – just read (but look it is not Earthquakes in California!)

Isolating your selected features from the unselected features: creating .lyr file and creating a new data file

Once you have selected the features you are most interested in you may want to work with just these features and have the other features hidden or removed altogether. Here are your options:

1.  Perform a Definition Query as mention in #3 above.

2.  Create a .lyr file that saves the selected features so you only see the selected features. I like this method because it does not alter your original data AND it does not duplicate your original data. Remember a .lyr file is just directions telling your data how to look. The .lyr file will not work unless it knows where your data are. You do not need to create a .lyr file to save some customized look in your .mxd (ArcMap project file.) This is automatically saved with the project, however if you wish to bring this customized look into another project you will need to create a .lyr file.

3.  Create a new data file (either a .shp or .mdb file – geodatabase – we will cover later) from the selected features.

To create a .lyr file of selected features

  1. After the desired features are selected, right-click on the data layer (in the TOC) from which you want to create the .lyr file.
  2. Now you have two options: Click “Save as a Layer File” which will create a .lyr file of the entire data layer (selected and unselected features) or to create a .lyr file of just the selected features. Go to “Selection” then select “Create Layer from Selected Features”.
  3. Navigate to the folder in which you want to save the layer.
  4. Type a name for the .lyr file.
  5. Click Save.
  6. Remove the layers in the TOC you do not need (right-click on the layer and select “Remove”

To create a new data file that contains just the selected features.

  1. Right-click the data source (in the TOC) from which you want to create a new data file.
  2. Select “Data” and then “Export Data”
  3. This dialog box will come up

Note you have a few options:

  1. You can “Use the same Coordinate System as this layer’s source data”, or
  2. Use the same coordinate system as the data frame.

Lastly, make sure your new data file is going to a place you want to put it and give it an appropriate name. PAY ATTENTION TO THIS, otherwise you create lots of junk in random places!

2