5. Querying a View

             5.1 Many Ways to Select Map Features

                     * |  |  |  |

             5.2 Demo

Select features by location

Select features by attributes

 

5. Querying a View

 

Selecting features on a view enables you to find specific geographic features that interest you or meet certain important criteria, and to work with specific geographic features in a variety of ways to find out more about them.

Features highlight on the view when they are selected and remain highlighted until a different selection is made, or until they are deselected. By default, selected features highlight in yellow. You can choose the color in which features are highlighted when they are selected, by making the Project window active then choosing Properties from the Project menu.

 

Selecting features with the mouse

The Select Feature tool  lets you select features with the mouse by pointing at them or by dragging a selection box over them. Features that fall partly or wholly inside the box you define will be selected. Features will be selected from all of the currently active themes.

Selecting features using graphic

The Select Features Using Graphic button  lets you select features that fall inside (for point) or are intersected by graphics (for line and polygon) such as circles, boxes, lines and polygons that you have already drawn on a view using the Draw tools ¡¦. . Features will be selected from all of the currently active themes.

 

Selecting a feature using Find

Find  is a quick way to select a particular feature of interest. Find works by searching the features to find the first feature with the value you specified, in any of its text attribute fields. Find only lets you select one feature at a time. Find doesn¡¯t search in numeric fields. You don't need to enclose the text you specify in quotes. Find is not case-sensitive. You can enter part of the text. Wildcard characters are not supported by Find.

 

Selecting features by selecting records in a theme's table

When you use the Select tool  to select records in the table describing a theme's features, the features that these records represent are selected on the view. This is especially useful if you work with a table and a view side-by-side because you can browse through the table, select records for features that interest you, then see where they are on the view. Hold down SHIFT when you use the Select tool to select more than one record in a table.

 

  Selecting features using a query

 

Build a query with the Query Builder  when you want to select features according to their attribute values. For example, you can build a query to select all the states in the USA with populations greater than 10 million. You can build more complex queries too. You can also use the Query Builder to narrow down your selection by building a query that only selects features from the set you have already selected.

 

 

Select features by location

 

a.       Make a theme active

b.      Click the Select Feature tool

c.       Hold down the Shift key and click on features of interest

 

¡§ Unselecting features

If you select the wrong feature, you can unselect it by holding down the Shift key and clicking on it again

 

¡§ Selecting features within a rectangle area

You can draw rectangle with the Select Feature tool. Point features within the rectangle will be selected; Line or polygon features that intersect the rectangle will be selected

 

¡§ Selecting features using graphics

You can draw graphic using graphic drawing tool. To do this, first click the Draw Point button  and drag a mouse a little bit down on the button. It will let you choose the shapes of graphics you want to draw (e.g., point, line, polygon). Suppose you draw polygon. So choose , and draw polygons such that the polygon can be the area within which you want to select features. Double-clicking will finish drawing polygon. Now the Select Features Using Graphic button  will be enabled. Click the button. The features that intersect the graphic you drew will be selected. You can delete graphics with Delete key as long as the graphic is selected (which may appear as the four rectangles for the extent of graphics). Pointer button  is use to select graphics.

 

d.      Open Theme Table  (now you will be in a table)

e.       Move selected records to the top by clicking Promote button

f.        Clear selected features by clicking

You can also switch the selection by clicking

 

 

Select features by attributes

 

a.       Make a theme active

b.      Click the Query Builder

 

¡§ Query Builder lets you select features by defining a query based on their attributes. To build a query, choose a Field, then an Operator, then a Value. You build a query by double-clicking on these options with the mouse or by typing your query directly into the query text box. For example, to select all the houses of more than 1,500 square feet, you could use the query:  ( [area] > 1500 )

 

 

¡§ Strings such as names are always quoted in queries. Queries on non-indexed fields are case insensitive, so you can select California with:

 

 ( [state_name] = "california" )

 

Use * as a multiple character wildcard. For example, to select Mississippi you could use the query:

 

 ( [state_name] = "missi*" )

 

Use ? in a string as a single character wildcard. For example, to find Catherine Smith and Katherine Smith, use:

 

 ( [owner_name] = "?atherine smith" )

 

To select all the cities with names starting with the letters M to Z, you could use:

 

 ( [city_name] >= "m" )

 

 

 

¡§ Complex queries can be built by combining expressions together with the And and Or operators. For example, to select all the houses that have more than 1,500 square feet and a garage for three or more cars, use the query:

 

 ( [area] > 1500) and ( [garage] > 3 )

 

Use the Not operator to exclude. For example, to select all the New England states except Maine, use the query:

 

 ( [sub_region] = "N Eng") and ( not ( [state_name] = "Maine") )

 

Queries can compare the values of two fields. For example to find all the counties with a declining population, use the query:

 

 ( [pop1990] < [pop1980] )

 

 

 

¡§ Calculations can be included in queries. For example, to find the counties with a population density of less or equal to 25 people per square mile, you could use the query:

 

 ( [pop1990] / [area] <= 25 )

 

Normally ArcView evaluates a query from left to right, but expressions that you enclose in parentheses are evaluated first. For example, the query:

 

 ( [netvalue] > [area] * [price] + [tax] )

 

will be evaluated differently from:

 

 ( [netvalue] > [area] * ( [price] + [tax] ) )

 

c.       Click New Set button

 

¡§New Set: Makes a new selected set containing the features or records selected in your query. Features or records not in this set are deselected.

 

¡§Add To Set: Adds the features or records selected in your query to the existing selected set. If there is no existing selected set, the features or records specified in the query become a new set. Use this option to widen your selection.

 

¡§Select From Set:  Selects the features or records in your query from the existing selected set. Only those features or records in this existing set that are selected in your query will remain in the selected set. Use this option to narrow down your selection.

d.      Click the Zoom to Selected button