Lecture 10 GIS SSM - PPTX MN
Lecture 10 GIS SSM - PPTX MN
1
1. Approaches for GIS queries
2. Thematic query:
3. Geometric query:
4. Topological query:
Query operators
The thematic query relies on the analysis of technical data (attribute data).
The query is performed using adequate selecting operators.
Relational operators: Equal and not equal greater than, smaller …………
Arithmetic operators: These operators are used for numeric attributes. E.g. there is the possibility
to calculate the mean of an attribute or the sum of attribute values from a series of objects.
Logic operators: Conditions are formulated with logic operators. The semantics (meaning) of these
operators are similar to the meaning "AND", "OR" etc.
Relational operators
Shape ID Tree Type Density / m2 Soil type
For example, there is the possibility to calculate the mean or the sum of attribute
values from a series of objects.
SQL operator
SELECT Tree Type, Denisty, soil type, denisty *2/100 as
wood usage FROM Parzelle WHERE Density > 120;
Result Graph
Result Table
Shape ID Tree Type Density / Soil type Wood
m2 usage
polygon 1 Fitch 250 sandy 5
polygon 2 Tanne 250 silt 5
polygon 5 Bunch 300 wet 6
polygon 6 Fitch 130 dry 2.6
logical operators are used to combine the expressions (with two possible values "true" or "false").
Set difference
NOT True, if one is false.
(complement)
Shape ID Tree Type Density / m2 Soil type
polygon 1 Fitch 250 sandy
polygon 2 Tanne 250 silt
polygon 3 Kahls 0 sandy
polygon 4 Larche 120 clay
polygon 5 Bunch 300 wet
polygon 6 Fitch 130 dry
polygon 7 Larche 100 clay
E.g.: "Select all the houses that are located less than 250 m away
from the river".
Geometry is a property of an object, just as is the thematic. With the appropriate measuring
functions, queries can be performed. The general geometric queries are listed below:
•Buffering features
•Spatial Join
A buffer is a spatial expansion around points, lines, and Polygons defined by a distance
point
Line
Polygon
PostGIS is an open source software program that adds support for geographic objects to
the PostgreSQL object-relational database.
PostGIS follows the Simple Features for SQL specification and stores a table’s spatial
information in geometry columns.
The buffer is represented as a new geometry object, which can be used for further
spatial analysis.
It can be used to find the distance between two points, two lines, or the distance
between two polygons.
SELECT city.name
The WHERE clause filters the results to only include buildings that intersect with the park.
ST_Union in PostGIS
It can be used to merge several polygons into a single polygon or to merge several lines into
a single line.
The resulting geometry is represented as a new geometry object, which can be used for
further spatial analysis or visualization.
Interior
The interior of an object consists of points, lines or areas that are in
the object but do not belong boundary.
Exterior
The complement, also called exterior, consists of the points, lines and
areas which are not in the object.
The basic method used to compare two geometrical objects is to analyze
the intersections between all the possible pairs that can be built with the
interior, exterior and boundary of these two objects.
Two objects, A and B, both of them are represented by their interior (i),
boundary (b) and exterior (e).
There are nine possible relations of these two geometrical objects. They
are shown in the following table.
•Interior, boundary, exterior
•Let A be an object in a “Universe” U.
Green is A interior ( Ao )
U
A Blue –(Green + Red) is
( A )
A exterior
Compare only boundary and interior without exterior
Disjoint
There is no intersection area between object A and object B. Test for disjoint.
Meet
Object A and object B meet at the boundary.
The boundaries meet, but not the interior.
Two geometry objects meet if the boundaries touch.
Overlap
Object A and object B overlap. Test for intersect (inversion of disjoint).
Object A contains object B. Test whether the initial geometry object encloses a different
geometry object.
The interior and the boundary of an object are completely inside of the other object.
A geometry object cannot contain a geometry object of higher order. E.g.:
• Points can not contain lines or polygons.
• Lines can not contain polygons.
Object A lies inside object B.
It is the opposite of "contain". If A is inside B, then B contains A
Object A covers object B. The interior of an object is completely inside the other
object and the boundaries intersect.
It is the opposite of "covers". If A is covered by B, then B covers A