Automating Google Workspace (GWS) & more with Apps Script
ArcGIS Queries (3Nov2011)
1. Maneesh Sharma
West Virginia GIS Technical Center
Department of Geology and Geography
West Virginia University
Morgantown 26505
Maneesh.Sharma@mail.wvu.edu
2. Queries in feature classes
◦ Attribute Query
Demonstration
◦ Location Query
Demonstration
Query in Data driven Pages
◦ Dynamic query
Demonstration
Questions
3. Attribute Query
◦ “A query that extracts data/features from a layer
based on the value of its attribute data”
Query can be
◦ Simple query
◦ Compound query
Subquery
4. A query expression needs 3 components
◦ Attribute Field Operator Field Attribute Value
"AssessedAcres" >= 0.19
◦ The result will show a set of selected features
5. Different types of operators can be used
Calculations can be done
◦ "AssessedAcres" >= 0.12 * 100
Or
"Perimeter" >= "Acres" * 10
6. Multiple attribute and operators can be used
to create compound query
◦ Complex expressions can be created by using AND
or OR
"Perimeter" >= 7361.83 or "Acres" <= 0.35
7. A subquery is a nested query
Supported just by geodatabase data sources
only
Will NOT work with shapefiles
"Entity" NOT IN (SELECT "ENTITY" FROM
BLDTYPES2)
Demonstration
8. A location query is based on their location
relative to other features that meet certain
conditions
Main types
◦ Near
◦ Intersect
◦ Inside
9. Three things needed for query
◦ Layer that contains features you want to select
◦ Location relationship that needs to be analyzed
◦ Layer that contains related features
“Building types within 2000 ft of selected
parcel”
Demonstration
10. Each layer can take advantage of the Data
Driven Page setup
Layer has to have the page number from the
index layer associated with the features
By setting the Page Definition by using page
number, you can show or hide each feature
on the map