Spatial & Attribute Queries Flashcards

Lecture 15

1
Q

What is a query?

A
  1. Attribute Queries
    * Select spatial features based on attribute information.
  2. Spatial Queries
    * Select spatial features based on their location relationships.
    * The type of query depends on the type of data being inventoried
    * Queries are “(que)-stions” being asked.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an attribute query?

A

Attribute queries retrieves a subset of data from a complete set of attribute data
The selected data subset can also be saved for further processing.
* Typically presented in .shp/.dbf format (but doesn’t have to be).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is SQL?

A

SQL- structured query language

AcrGIS uses SQL for query operations.
it is designed for the manipulation of relational databases.
It is a command language used to communicate with the database.
new development allows SQL to be used by object orientated databases too.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do we use SQL?

A

To use SQL to access a database we must use the following
structure:
select < attribute >
from < relation>
where < condition >
The select keyword selects fields from the database
The from keyword selects tables from the database
The where keyword specifies the condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SQL expression in ArcGIS?

A

Query or the where conditions consists of Boolean expressions
and connectors
* A Boolean expression contains two operands and a logical
operator.
The “ = “ is known as a Boolean operator or logical operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Boolean logic

A

a>b - greater than
a<b - less than
a=b - equal
a>=b - greater or equal
a<=b - less or equal
a<>b - not equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Mathematical operators

A

a+b - addition
a -b - subtraction
a*b - multiplication
a/b - division
a^b - exponention

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are boolean connectors?

A

used to connect 2 or more expressions.

Complement of data subset A:
Elements that do NOT belong to
Union of data subsets A and B:
Elements that belong to A OR B or both
Intersection of A and B:
Elements that belong to both A AND B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Type of operations?

A

❑ Type operations select a subset and divide it into two
groups:
1. The selected records
2. Unselected records
❑ The new “New” subset
3 types of operations:
–Add more records
–Subtract records
–Select smaller subset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What kinds of operations are performed?

A
  • “New”subset (=40)
  • Add more records to the subset (+2 = 42)
  • Remove records from the subset (-5 = 35 )
  • Select a smaller subset (=20)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are spatial queries?

A

the process of retrieving a data subset from a layer by working directly with feature geometries.

Spatial Queries
** Select spatial features based on their location relationships.**
* e.g. Find all the South African cities within 100 km of the Namibian
border.
* Select features using
* Cursor + Graphic + Spatial relationship between features (topology!)
* Results can be displayed on a map, linked to records in a table,
displayed in charts, or saved as a new data set for further
processing

** Select features based on their spatial/topological relationship
to other features**
* In same layer or in different layers
– Containment: Selects features that fall completely within features
for selection. Eg. find schools in a neighborhood.
– Intersect: Selects features that intersect features for selection
(crossed by the outline..). Eg. Select land parcels that intersect a
proposed road.
– Proximity: Selects features that are within a specified distance of
features for selection. Eg. Find a grocery shop within 1km of
selected roads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to combine spatial and attribute queries?

A

❑ Solving a site selection problem
Wildcat Boat Company is planning to construct a small testing facility and
office building. They have narrowed the proposed site to a farming area
near a large lake. The company now needs to select a specific site that
meets the following requirements:
▪ The site should not have trees. The other land uses (urban, barren and
wetlands) are also out. So, the land cover must be “brush land” or
LUCODE 300.
▪ The site must be at least 4000 square meters in size to provide space
for building and grounds.
▪ A local ordinance designed to prevent rampant development allows
new construction only within 300 meter of existing sewer lines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a raster data query?

A
  • Raster cell represent Value + Location
  • Raster query is similar to Vector, the where condition consist of Boolean expressions and connectors
  • Boolean expressions - Eg: [road] = 1 - (‘road’ & ’ 1’ are operands & ‘=’
    s a logical operator)
  • Boolean connectors – A compound statement with separate expressions usually applies to multiple rasters. Eg: ([slope] = 2) AND ([aspect] = 1)
  • Querying multiple rasters directly is unique to raster data.
  • For vector data all attributes in a compound expression, must be from the same table or joined tables
  • ArcGIS has dialogs specifically designed for vector data, but NOT for raster query.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly