Professional Documents
Culture Documents
Gis Geographic Information Systems Lec 4 Part B
Gis Geographic Information Systems Lec 4 Part B
GENERAL OVERLAY
TYPES
•Identity
–spatial join or point-in-
polygon
•Clip
–similar to set extent when
using raster data
•Intersection
•Buffer
(forall of the above, operations are on
layers, not single polygons
SPATIAL JOIN
•point buffer
Buffer operations
•line buffer
-how many people live near
the polluted river?
-what is the area impacted
by highway noise?
Buffer Operations
•polygon buffer
- area around a tank where
development should not be
permitted
Clip
Two polygons, A and B, Overlap. Clip
A using B as a cookie cutter.
CREATING SUBSETS
POINT IN A POLYGON
AN ER EXAMPLE
WORLD DATABASE
•Conceptual Model
POPULATING TABLES IN
SQL
Downloaded by Shayma Tarek (shayma190852@hu.edu.eg)
lOMoARcPSD|28345601
SELECT EXAMPLE 1.
•Simplest Query has SELECT and FROM clauses
•Query: List all the cities and the country
they belong to.
SELECT EXAMPLE 2.
•Query: List the names of the capital cities in
the CITY table.
WHERE CAPITAL="Y ‟
SQL EXAMPLE 3
Result ->
SQL EXAMPLE 4:
MULTI-TABLE QUERY
SQL EXAMPLE 5:
AGGREGATE STAISTICS
SELECT AVG(Ci.Pop)
FROM City Ci
WHERE Ci.Capital=“N ‟
SQL EXAMPLE 6
Query: For each country in which at
least two rivers
originate, find the length of the
smallest river.
SPATIAL OPERATIONS
WITH SQL
Downloaded by Shayma Tarek (shayma190852@hu.edu.eg)
lOMoARcPSD|28345601
•Spatial Analysis
•Distance: return the shortest distance
between two geometries
•Buffer: returns zone around some
geometries
•Intersection: Returns the intersection of
two geometries
•Union: Returns the union of two
geometries
•Difference: returns the portion of a
geometry that does not intersect with
another given geometry.
•SymmDif: returns the portions of two
geometry that do not intersect with
each other.
SELECT Co.GDP,
Distance(Point(0,Ci.Shape.y),Ci.Shape) AS
"Distance"
FROM Country Co,City Ci WHERE Co.Name
= Ci.Country AND Ci.Capital =„Y ‟
SELECT
Co.Name,
Count(Co1.Nam
e) FROM
Country Co,
Country Co1
WHERE
Touch(Co.Shap
e,Co1 .Shape)
GROUP BY
Co.Name
ORDER BY Count(Co1.Name)
NESTED SPATIAL
QUERY
SELECT Co.Name
FROM Country Co
WHERE Co.Name IN (SELECT Co.Name
FROM
Country
Co,Coun
try Co1
WHERE
Touch(
Co.Shap
e,Co1.S
hape)
GROUP
BY
Co.Nam
e
HAVING Count(*)=1)
BASIC FUNCTIONS
References
•http://delab.csd.auth.gr/~tiakas/query
_languages.pdf
•https://www.youtube.com/channel/UC
M116w7f8gSXCCCb3k1aNZQ
•https://www.youtube.com/watch?
v=65TnKwCqpy0&list=PLRNNjIk9Ar
AoSycesz6wc5sJshpwncKmU&inde
x=1
•Lecture notes from Dr. Taysir
Hassan Abdel Hamid Faculty of
Computers and Information
Assiut University