Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESQL: Fix issues with ST_* functions and compound geometries #106992

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ id:l, name:keyword, shape:cartesian_shape
7, Bottom right with holes, "POLYGON((2 0\, 3 0\, 3 1\, 2 1\, 2 0)\, (2.4 0.4\, 2.6 0.4\, 2.6 0.6\, 2.4 0.6\, 2.4 0.4))"
8, Top right with holes, "POLYGON((2 2\, 3 2\, 3 3\, 2 3\, 2 2)\, (2.4 2.4\, 2.6 2.4\, 2.6 2.6\, 2.4 2.6\, 2.4 2.4))"
9, Top left with holes, "POLYGON((0 2\, 1 2\, 1 3\, 0 3\, 0 2)\, (0.4 2.4\, 0.6 2.4\, 0.6 2.6\, 0.4 2.6\, 0.4 2.4))"
10, Four diagonals, "MULTILINESTRING((0 0\, 1 1)\, (2 0\, 3 1)\, (2 2\, 3 3)\, (0 2\, 1 3))"
11, Bottom left diagonal, "LINESTRING(0 0\, 1 1)"
12, Bottom right diagonal, "LINESTRING(2 0\, 3 1)"
13, Top right diagonal, "LINESTRING(2 2\, 3 3)"
14, Top left diagonal, "LINESTRING(0 2\, 1 3)"
15, Four points, "MULTIPOINT(0.5 0.5\, 2.5 0.5\, 2.5 2.5\, 0.5 2.5)"
16, Bottom left point, "POINT(0.5 0.5)"
17, Bottom right point, "POINT(2.5 0.5)"
18, Top right point, "POINT(2.5 2.5)"
19, Top left point, "POINT(0.5 2.5)"
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ FROM cartesian_multipolygons
| SORT id
;

id:l | name:keyword | shape:cartesian_shape
0 | Four squares | MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0)), ((2 0, 3 0, 3 1, 2 1, 2 0)), ((2 2, 3 2, 3 3, 2 3, 2 2)), ((0 2, 1 2, 1 3, 0 3, 0 2)))
1 | Bottom left | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))
id:l | name:keyword | shape:cartesian_shape
0 | Four squares | MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0)), ((2 0, 3 0, 3 1, 2 1, 2 0)), ((2 2, 3 2, 3 3, 2 3, 2 2)), ((0 2, 1 2, 1 3, 0 3, 0 2)))
1 | Bottom left | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))
5 | Four squares with holes | MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0), (0.4 0.4, 0.6 0.4, 0.6 0.6, 0.4 0.6, 0.4 0.4)), ((2 0, 3 0, 3 1, 2 1, 2 0), (2.4 0.4, 2.6 0.4, 2.6 0.6, 2.4 0.6, 2.4 0.4)), ((2 2, 3 2, 3 3, 2 3, 2 2), (2.4 2.4, 2.6 2.4, 2.6 2.6, 2.4 2.6, 2.4 2.4)), ((0 2, 1 2, 1 3, 0 3, 0 2), (0.4 2.4, 0.6 2.4, 0.6 2.6, 0.4 2.6, 0.4 2.4)))
6 | Bottom left with holes | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0), (0.4 0.4, 0.6 0.4, 0.6 0.6, 0.4 0.6, 0.4 0.4))
6 | Bottom left with holes | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0), (0.4 0.4, 0.6 0.4, 0.6 0.6, 0.4 0.6, 0.4 0.4))
10 | Four diagonals | MULTILINESTRING((0 0, 1 1), (2 0, 3 1), (2 2, 3 3), (0 2, 1 3))
11 | Bottom left diagonal | LINESTRING(0 0, 1 1)
15 | Four points | MULTIPOINT(0.5 0.5, 2.5 0.5, 2.5 2.5, 0.5 2.5)
16 | Bottom left point | POINT(0.5 0.5)
;

whereContainsSinglePolygon
Expand All @@ -41,9 +45,11 @@ FROM cartesian_multipolygons
| SORT id
;

id:l | name:keyword | shape:cartesian_shape
1 | Bottom left | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))
6 | Bottom left with holes | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0), (0.4 0.4, 0.6 0.4, 0.6 0.6, 0.4 0.6, 0.4 0.4))
id:l | name:keyword | shape:cartesian_shape
1 | Bottom left | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))
6 | Bottom left with holes | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0), (0.4 0.4, 0.6 0.4, 0.6 0.6, 0.4 0.6, 0.4 0.4))
11 | Bottom left diagonal | LINESTRING(0 0, 1 1)
16 | Bottom left point | POINT(0.5 0.5)
;

####################################################################################################
Expand All @@ -62,6 +68,10 @@ id:l | name:keyword | shape:cartesian_shape
1 | Bottom left | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))
5 | Four squares with holes | MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0), (0.4 0.4, 0.6 0.4, 0.6 0.6, 0.4 0.6, 0.4 0.4)), ((2 0, 3 0, 3 1, 2 1, 2 0), (2.4 0.4, 2.6 0.4, 2.6 0.6, 2.4 0.6, 2.4 0.4)), ((2 2, 3 2, 3 3, 2 3, 2 2), (2.4 2.4, 2.6 2.4, 2.6 2.6, 2.4 2.6, 2.4 2.4)), ((0 2, 1 2, 1 3, 0 3, 0 2), (0.4 2.4, 0.6 2.4, 0.6 2.6, 0.4 2.6, 0.4 2.4)))
6 | Bottom left with holes | POLYGON((0 0, 1 0, 1 1, 0 1, 0 0), (0.4 0.4, 0.6 0.4, 0.6 0.6, 0.4 0.6, 0.4 0.4))
10 | Four diagonals | MULTILINESTRING((0 0, 1 1), (2 0, 3 1), (2 2, 3 3), (0 2, 1 3))
11 | Bottom left diagonal | LINESTRING(0 0, 1 1)
15 | Four points | MULTIPOINT(0.5 0.5, 2.5 0.5, 2.5 2.5, 0.5 2.5)
16 | Bottom left point | POINT(0.5 0.5)
;

whereContainsSmallerPolygon
Expand All @@ -86,6 +96,7 @@ FROM cartesian_multipolygons
;

id:l | name:keyword | shape:cartesian_shape
16 | Bottom left point | POINT(0.5 0.5)
;

####################################################################################################
Expand All @@ -110,6 +121,16 @@ id:l | name:keyword | shape:cartesian_shape
7 | Bottom right with holes | POLYGON((2 0, 3 0, 3 1, 2 1, 2 0), (2.4 0.4, 2.6 0.4, 2.6 0.6, 2.4 0.6, 2.4 0.4))
8 | Top right with holes | POLYGON((2 2, 3 2, 3 3, 2 3, 2 2), (2.4 2.4, 2.6 2.4, 2.6 2.6, 2.4 2.6, 2.4 2.4))
9 | Top left with holes | POLYGON((0 2, 1 2, 1 3, 0 3, 0 2), (0.4 2.4, 0.6 2.4, 0.6 2.6, 0.4 2.6, 0.4 2.4))
10 | Four diagonals | MULTILINESTRING((0 0, 1 1), (2 0, 3 1), (2 2, 3 3), (0 2, 1 3))
11 | Bottom left diagonal | LINESTRING(0 0, 1 1)
12 | Bottom right diagonal | LINESTRING(2 0, 3 1)
13 | Top right diagonal | LINESTRING(2 2, 3 3)
14 | Top left diagonal | LINESTRING(0 2, 1 3)
15 | Four points | MULTIPOINT(0.5 0.5, 2.5 0.5, 2.5 2.5, 0.5 2.5)
16 | Bottom left point | POINT(0.5 0.5)
17 | Bottom right point | POINT(2.5 0.5)
18 | Top right point | POINT(2.5 2.5)
19 | Top left point | POINT(0.5 2.5)
;

whereContainsLargerPolygon
Expand Down Expand Up @@ -142,6 +163,16 @@ id:l | name:keyword | shape:cartesian_shape
7 | Bottom right with holes | POLYGON((2 0, 3 0, 3 1, 2 1, 2 0), (2.4 0.4, 2.6 0.4, 2.6 0.6, 2.4 0.6, 2.4 0.4))
8 | Top right with holes | POLYGON((2 2, 3 2, 3 3, 2 3, 2 2), (2.4 2.4, 2.6 2.4, 2.6 2.6, 2.4 2.6, 2.4 2.4))
9 | Top left with holes | POLYGON((0 2, 1 2, 1 3, 0 3, 0 2), (0.4 2.4, 0.6 2.4, 0.6 2.6, 0.4 2.6, 0.4 2.4))
10 | Four diagonals | MULTILINESTRING((0 0, 1 1), (2 0, 3 1), (2 2, 3 3), (0 2, 1 3))
11 | Bottom left diagonal | LINESTRING(0 0, 1 1)
12 | Bottom right diagonal | LINESTRING(2 0, 3 1)
13 | Top right diagonal | LINESTRING(2 2, 3 3)
14 | Top left diagonal | LINESTRING(0 2, 1 3)
15 | Four points | MULTIPOINT(0.5 0.5, 2.5 0.5, 2.5 2.5, 0.5 2.5)
16 | Bottom left point | POINT(0.5 0.5)
17 | Bottom right point | POINT(2.5 0.5)
18 | Top right point | POINT(2.5 2.5)
19 | Top left point | POINT(0.5 2.5)
;

####################################################################################################
Expand All @@ -166,6 +197,16 @@ id:l | name:keyword | shape:cartesian_shape
7 | Bottom right with holes | POLYGON((2 0, 3 0, 3 1, 2 1, 2 0), (2.4 0.4, 2.6 0.4, 2.6 0.6, 2.4 0.6, 2.4 0.4))
8 | Top right with holes | POLYGON((2 2, 3 2, 3 3, 2 3, 2 2), (2.4 2.4, 2.6 2.4, 2.6 2.6, 2.4 2.6, 2.4 2.4))
9 | Top left with holes | POLYGON((0 2, 1 2, 1 3, 0 3, 0 2), (0.4 2.4, 0.6 2.4, 0.6 2.6, 0.4 2.6, 0.4 2.4))
10 | Four diagonals | MULTILINESTRING((0 0, 1 1), (2 0, 3 1), (2 2, 3 3), (0 2, 1 3))
11 | Bottom left diagonal | LINESTRING(0 0, 1 1)
12 | Bottom right diagonal | LINESTRING(2 0, 3 1)
13 | Top right diagonal | LINESTRING(2 2, 3 3)
14 | Top left diagonal | LINESTRING(0 2, 1 3)
15 | Four points | MULTIPOINT(0.5 0.5, 2.5 0.5, 2.5 2.5, 0.5 2.5)
16 | Bottom left point | POINT(0.5 0.5)
17 | Bottom right point | POINT(2.5 0.5)
18 | Top right point | POINT(2.5 2.5)
19 | Top left point | POINT(0.5 2.5)
;

whereContainsEvenLargerPolygon
Expand Down Expand Up @@ -198,4 +239,14 @@ id:l | name:keyword | shape:cartesian_shape
7 | Bottom right with holes | POLYGON((2 0, 3 0, 3 1, 2 1, 2 0), (2.4 0.4, 2.6 0.4, 2.6 0.6, 2.4 0.6, 2.4 0.4))
8 | Top right with holes | POLYGON((2 2, 3 2, 3 3, 2 3, 2 2), (2.4 2.4, 2.6 2.4, 2.6 2.6, 2.4 2.6, 2.4 2.4))
9 | Top left with holes | POLYGON((0 2, 1 2, 1 3, 0 3, 0 2), (0.4 2.4, 0.6 2.4, 0.6 2.6, 0.4 2.6, 0.4 2.4))
10 | Four diagonals | MULTILINESTRING((0 0, 1 1), (2 0, 3 1), (2 2, 3 3), (0 2, 1 3))
11 | Bottom left diagonal | LINESTRING(0 0, 1 1)
12 | Bottom right diagonal | LINESTRING(2 0, 3 1)
13 | Top right diagonal | LINESTRING(2 2, 3 3)
14 | Top left diagonal | LINESTRING(0 2, 1 3)
15 | Four points | MULTIPOINT(0.5 0.5, 2.5 0.5, 2.5 2.5, 0.5 2.5)
16 | Bottom left point | POINT(0.5 0.5)
17 | Bottom right point | POINT(2.5 0.5)
18 | Top right point | POINT(2.5 2.5)
19 | Top left point | POINT(0.5 2.5)
;
Loading