Presentation is loading. Please wait.

Presentation is loading. Please wait.

Queries Select by Attribute Select by Location. What is a Query? A query extracts information from a data table for further use –Once extracted you can:

Similar presentations


Presentation on theme: "Queries Select by Attribute Select by Location. What is a Query? A query extracts information from a data table for further use –Once extracted you can:"— Presentation transcript:

1 Queries Select by Attribute Select by Location

2 What is a Query? A query extracts information from a data table for further use –Once extracted you can: Print, calculate stats, edit, graph, save as a new layer, do more queries Queries come in two different flavors: –Attribute queries –Spatial queries

3 ArcGIS Selection methods ArcGIS has three methods for selecting features –Interactive Selection –Select by Attributes –Select by Location

4 Interactive Selection This feature allows use of the select feature tool and the manual selection of features in a table or map You can also use a graphic to select features (i.e.: box, line, circle, etc.

5 Copyright © 2006 by Maribeth H. Price 6-5 Interactive Selection Select Features tool Click on feature to select Hold down shift key to select more than one feature Draw a rectangle that passes through features to be selected.

6 Copyright © 2006 by Maribeth H. Price 6-6 Selectable Layers States selectable All layers selectable

7 Copyright © 2006 by Maribeth H. Price 6-7 Selection options

8 Copyright © 2006 by Maribeth H. Price 6-8 Clear Selection On toolbar From table options menu From main menu

9 Selection by Attributes The user specifies criteria based on fields in the attribute table –This involves an expression using Structured Query Language (SQL) Expressions are written using the fields buttons accessed in the Select By Attributes window –SELECT *FROM and WHERE keywords are present to help spell out the query

10 Copyright © 2006 by Maribeth H. Price 6-10 AND vs OR “Land-use” = ‘RES’ AND “Land-use” = ‘COM’ “Land-use” = ‘RES’ OR “Land-use” = ‘COM’ “Pop2000” ≥ 5000 OR “Pop2000” < 9000 “Pop2000” ≥ 5000 AND “Pop2000” < 9000 Wrong Right Remember—you test each feature separately

11 Use of Boolean Operators SELECT *FROM accounts WHERE “Cust” = ‘COM’ AND “Balance” > 500 SELECT *FROM accounts WHERE “Cust” = ‘COM’ OR “Cust” = ‘GOV’ SELECT *FROM accounts WHERE [BALANCE] > 500 AND [BALANCE] <1500 SELECT *FROM parcels WHERE (“LUCODE” = 42 AND “VALUE” > 50000) OR “SIZE” > 50 SELECT *FROM parcels WHERE “LUCODE” = 42 AND (“VALUE” > 50000 OR “SIZE” > 50)

12 Copyright © 2006 by Maribeth H. Price 6-12 Multiple conditions Use parentheses to enforce order of evaluation (“LU” = ‘RES’ or “LU” = ‘COM’) and “Value” > 100000 “LU” = ‘RES’ or (“LU” = ‘COM’ and “Value” > 100000) $75,000 $125,000 $75,000 $125,000 $75,000 $125,000 $75,000 $125,000 RESCOM

13 Selection by Location This powerful feature allows selections based on spatial features –Two layers are used for the selection, i.e.: the number of homes in a flood plain Select By Location allows many different options: –Intersect, contain, identical to, have their center in, are completely within, etc.

14 Copyright © 2006 by Maribeth H. Price 6-14 Select By Location Select counties that completely contain state capitals Select counties that are within 200 miles of Denver

15 Copyright © 2006 by Maribeth H. Price 6-15 Select By Location Select counties that intersect rivers Select rivers that intersect Texas

16 Copyright © 2006 by Maribeth H. Price 6-16 Select By Location Select cities that are within 20 miles of an interstate highway Select cities that are completely within counties named Washington

17 Copyright © 2006 by Maribeth H. Price 6-17 Selecting by location

18 Copyright © 2006 by Maribeth H. Price 6-18 Intersect

19 Copyright © 2006 by Maribeth H. Price 6-19 Within distance of

20 Copyright © 2006 by Maribeth H. Price 6-20 Creating layers Common operation following a query Creates a layer file

21 Copyright © 2006 by Maribeth H. Price 6-21 Creating layers

22 Copyright © 2006 by Maribeth H. Price 6-22 Exporting selections Creates new shapefile

23 Choosing the Selection Method ArcMap has four possible methods for the selection of features –Create new selection –Add to current Selection –Remove from current selection –Select from current selection


Download ppt "Queries Select by Attribute Select by Location. What is a Query? A query extracts information from a data table for further use –Once extracted you can:"

Similar presentations


Ads by Google