Successfully reported this slideshow.                                                                Upcoming SlideShare
×

# The DE-9IM Matrix in Details using ST_Relate: In Picture and SQL

The DE-9IM matrix is the foundation for understanding how spatial relationships are implemented in DBMSs like PostgreSQL, Oracle, and Microsoft SQL Server. This presentation makes a structure walk-through of most of the cases using a very large number of examples.

• Full Name
Comment goes here.

Are you sure you want to Yes No • Be the first to like this

### The DE-9IM Matrix in Details using ST_Relate: In Picture and SQL

1. 1. DE-9IM in Details using ST Relate: In Picture and SQL Kristian Torp Department of Computer Science Aalborg University people.cs.aau.dk/˜torp torp@cs.aau.dk November 22, 2015 daisy.aau.dk Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 1 / 64
2. 2. Outline 1 Introduction 2 Polygon/Polygon Examples 3 Polygon/Linestring Examples 4 Polygon/Point Examples 5 Linestring/Linesting Examples 6 Linestring/Point Examples 7 Summary Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 2 / 64
3. 3. Learning Goals Goals Learn the details of the DE-9IM Matrix Understand how to use ST Relate to get the DE-9IM Matrix See that ST Relate is the most general of the relationship functions Note Will focus on 2D geometries Concepts are general Code is sometimes PostgreSQL speciﬁc PostgreSQL: ST Make2DBox, SQL Server : STMake2DBox Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 3 / 64
4. 4. Outline 1 Introduction 2 Polygon/Polygon Examples 3 Polygon/Linestring Examples 4 Polygon/Point Examples 5 Linestring/Linesting Examples 6 Linestring/Point Examples 7 Summary Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 4 / 64
5. 5. Interior, Boundary, Exterior of Geometries Point Interior Boundary Exterior Linestring Interior Boundary Exterior Polygon Interior Boundary Exterior Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 5 / 64
6. 6. Overlap Result is a Point = 0D Geometry 1 Geometry 2 Overlap? Overlap Result Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 6 / 64
7. 7. Overlap Result is a Linestring = 1D Geometry 1 Geometry 2 Overlap? Overlap Result Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 7 / 64
8. 8. Overlap Result is a Polygon = 2D Geometry 1 Geometry 2 Overlap? Overlap Result Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 8 / 64
9. 9. No Overlap = F Geometry 1 Geometry 2 Overlap? Overlap Result Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 9 / 64
10. 10. ST Relate Example Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 2 Bou. F F 1 Ext. 1 0 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (1 ,1) , ST Point ( 6 , 1 ) ) ) −−> Actually returns DE−9IM Matrix as FF2FF1102 Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 10 / 64
11. 11. Understanding ST Relate on PostGIS Result of ST Relate Value Description 0 A 0D overlap, i.e., result is point(s) 1 A 1D overlap, i.e., result is linesting(s) 2 A 2D overlap, i.e., result is polygon(s) F Geometries do not overlap F = False Additional Result on other DBMS Value Description T Geometries overlap 0D, 1D or 2D T = True ∗ Do not care if geometries overlap or not Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 11 / 64
12. 12. Outline 1 Introduction 2 Polygon/Polygon Examples 3 Polygon/Linestring Examples 4 Polygon/Point Examples 5 Linestring/Linesting Examples 6 Linestring/Point Examples 7 Summary Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 12 / 64
13. 13. ST Relate, Polygon/Polygon, One Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 2 1 2 Bou. 1 0 1 Ext. 2 1 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (1 ,1) , ST Point ( 5 , 4 ) ) , ST MakeBox2D( ST Point (3 ,2) , ST Point ( 9 , 5 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 13 / 64
14. 14. ST Relate, Polygon/Polygon, One, Details Int/Int Int/Bou Int/Ext Bou/int Bou/Bou Bou/Ext Ext/int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 14 / 64
15. 15. ST Relate, Polygon/Polygon, Two Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 2 Bou. F 1 1 Ext. 2 1 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (1 ,1) , ST Point ( 7 , 3 ) ) , ST MakeBox2D( ST Point (3 ,3) , ST Point ( 9 , 5 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 15 / 64
16. 16. ST Relate, Polygon/Polygon, Two, Details Int/Int Int/Bou Int/Ext Bou/int Bou/Bou Bou/Ext Ext/int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 16 / 64
17. 17. ST Relate, Three Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 2 1 2 Bou. F F 1 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (1 ,1) , ST Point ( 9 , 5 ) ) , ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 17 / 64
18. 18. ST Relate, Polygon/Polygon, Three, Details Int/Int Int/Bou Int/Ext Bou/int Bou/Bou Bou/Ext Ext/int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 18 / 64
19. 19. ST Relate, Polygon/Polygon, Four Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 2 Bou. F F 1 Ext. 2 1 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (1 ,1) , ST Point ( 4 , 3 ) ) , ST MakeBox2D( ST Point (6 ,3) , ST Point ( 9 , 5 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 19 / 64
20. 20. ST Relate, Polygon/Polygon, Four, Details Int/Int Int/Bou Int/Ext Bou/int Bou/Bou Bou/Ext Ext/int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 20 / 64
21. 21. ST Relate, Polygon/Polygon, Five Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 2 F F Bou. F 1 F Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,1) , ST Point ( 8 , 5 ) ) , ST MakeBox2D( ST Point (2 ,1) , ST Point ( 8 , 5 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 21 / 64
22. 22. ST Relate, Polygon/Polygon, Four, Details Int/Int Int/Bou Int/Ext Bou/int Bou/Bou Bou/Ext Ext/int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 22 / 64
23. 23. Outline 1 Introduction 2 Polygon/Polygon Examples 3 Polygon/Linestring Examples 4 Polygon/Point Examples 5 Linestring/Linesting Examples 6 Linestring/Point Examples 7 Summary Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 23 / 64
24. 24. ST Relate, Polygon/Linestring, One Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 2 Bou. F F 1 Ext. 1 0 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (1 ,1) , ST Point ( 6 , 1 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 24 / 64
25. 25. ST Relate, Polygon/Linestring, One, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 25 / 64
26. 26. ST Relate, Polygon/Linestring, Two Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 1 0 2 Bou. 0 F 1 Ext. 1 0 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (1 ,3) , ST Point ( 6 , 3 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 26 / 64
27. 27. ST Relate, Polygon/Linestring, One, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 27 / 64
28. 28. ST Relate, Polygon/Linestring, Three Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 1 0 2 Bou. F F 1 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (3 ,3) , ST Point ( 7 , 3 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 28 / 64
29. 29. ST Relate, Polygon/Linestring, Three, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 29 / 64
30. 30. ST Relate, Polygon/Linestring, Four Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 2 Bou. 1 0 1 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (3 ,4) , ST Point ( 7 , 4 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 30 / 64
31. 31. ST Relate, Polygon/Linestring, Four, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 31 / 64
32. 32. ST Relate, Polygon/Linestring, Five Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 1 F 2 Bou. 0 F 1 Ext. 1 0 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (1 ,3) , ST Point ( 9 , 3 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 32 / 64
33. 33. ST Relate, Polygon/Linestring, Five, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 33 / 64
34. 34. ST Relate, Polygon/Linestring, Six Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 2 Bou. F 0 1 Ext. 1 0 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (2 ,1) , ST Point ( 8 , 2 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 34 / 64
35. 35. ST Relate, Polygon/Linestring, Six, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 35 / 64
36. 36. ST Relate, Polygon/Linestring, Seven Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 1 0 2 Bou. F 0 1 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (2 ,2) , ST Point ( 7 , 3 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 36 / 64
37. 37. ST Relate, Polygon/Linestring, Seven, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 37 / 64
38. 38. ST Relate, Polygon/Linestring, Eight Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 1 F 2 Bou. F 0 1 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST MakeLine ( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 38 / 64
39. 39. ST Relate, Polygon/Linestring, Eight, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 39 / 64
40. 40. Outline 1 Introduction 2 Polygon/Polygon Examples 3 Polygon/Linestring Examples 4 Polygon/Point Examples 5 Linestring/Linesting Examples 6 Linestring/Point Examples 7 Summary Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 40 / 64
41. 41. ST Relate, Polygon/Point, One Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 2 Bou. F F 1 Ext. 0 F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST Point ( 5 , 1 ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 41 / 64
42. 42. ST Relate, Polygon/Point, One, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 42 / 64
43. 43. ST Relate, Polygon/Point, Two Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 0 F 2 Bou. F F 1 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST Point ( 5 , 3 ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 43 / 64
44. 44. ST Relate, Polygon/Point, Two, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 44 / 64
45. 45. ST Relate, Polygon/Point, Three Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 2 Bou. 0 F 1 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeBox2D( ST Point (2 ,2) , ST Point ( 8 , 4 ) ) , ST Point ( 5 , 4 ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 45 / 64
46. 46. ST Relate, Polygon/Point, Three, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 46 / 64
47. 47. Outline 1 Introduction 2 Polygon/Polygon Examples 3 Polygon/Linestring Examples 4 Polygon/Point Examples 5 Linestring/Linesting Examples 6 Linestring/Point Examples 7 Summary Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 47 / 64
48. 48. ST Relate, Linestring/Linestring, One Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 1 Bou. F F 0 Ext. 1 0 2 Example (As SQL) select ST Relate ( ST MakeLine ( ST Point (1 ,3) , ST Point ( 6 , 3 ) ) , ST MakeLine ( ST Point (5 ,2) , ST Point ( 9 , 2 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 48 / 64
49. 49. ST Relate, Linestring/Linestring, One, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 49 / 64
50. 50. ST Relate, Linestring/Linestring, Two Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 1 Bou. F 0 0 Ext. 1 0 2 Example (As SQL) select ST Relate ( ST MakeLine ( ST Point (1 ,3) , ST Point ( 6 , 3 ) ) , ST MakeLine ( ST Point (6 ,3) , ST Point ( 9 , 3 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 50 / 64
51. 51. ST Relate, Linestring/Linestring, Two, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 51 / 64
52. 52. ST Relate, Linestring/Linestring, Three Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 1 0 1 Bou. 0 F 0 Ext. 1 0 2 Example (As SQL) select ST Relate ( ST MakeLine ( ST Point (1 ,3) , ST Point ( 6 , 3 ) ) , ST MakeLine ( ST Point (4 ,3) , ST Point ( 9 , 3 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 52 / 64
53. 53. ST Relate, Linestring/Linestring, Three, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 53 / 64
54. 54. ST Relate, Linestring/Linestring, Four Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 1 F F Bou. F 0 F Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeLine ( ST Point (1 ,3) , ST Point ( 6 , 3 ) ) , ST MakeLine ( ST Point (1 ,3) , ST Point ( 6 , 3 ) ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 54 / 64
55. 55. ST Relate, Linestring/Linestring, Four, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 55 / 64
56. 56. Outline 1 Introduction 2 Polygon/Polygon Examples 3 Polygon/Linestring Examples 4 Polygon/Point Examples 5 Linestring/Linesting Examples 6 Linestring/Point Examples 7 Summary Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 56 / 64
57. 57. ST Relate, Linestring/Point, One Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 1 Bou. F F 0 Ext. 0 F 2 Example (As SQL) select ST Relate ( ST MakeLine ( ST Point (2 ,3) , ST Point ( 8 , 3 ) ) , ST Point ( 5 , 1 ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 57 / 64
58. 58. ST Relate, Linestring/Point, One, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 58 / 64
59. 59. ST Relate, Linestring/Point, Two Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. 0 F 1 Bou. F F 0 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeLine ( ST Point (2 ,3) , ST Point ( 8 , 3 ) ) , ST Point ( 5 , 3 ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 59 / 64
60. 60. ST Relate, Linestring/Point, Two, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 60 / 64
61. 61. ST Relate, Linestring/Point, Three Example (As Picture) Example (DE-9IM Matrix) Int. Bou. Ext. Int. F F 1 Bou. 0 F 0 Ext. F F 2 Example (As SQL) select ST Relate ( ST MakeLine ( ST Point (2 ,3) , ST Point ( 8 , 3 ) ) , ST Point ( 8 , 3 ) ) Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 61 / 64
62. 62. ST Relate, Linestring/Point, Three, Details Int/Int Int/Bou Int/Ext Bou/Int Bou/Bou Bou/Ext Ext/Int Ext/Bou Ext/Ext Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 62 / 64
63. 63. Outline 1 Introduction 2 Polygon/Polygon Examples 3 Polygon/Linestring Examples 4 Polygon/Point Examples 5 Linestring/Linesting Examples 6 Linestring/Point Examples 7 Summary Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 63 / 64
64. 64. Summary: ST Relate Main Points ST Relate covers all the cases ST Relate fairly complex to understand and use Kristian Torp (Aalborg University) DE-9IM in Details using ST Relate: In Picture and SQL November 22, 2015 64 / 64