mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
PostGIS-style 'same point' handling.
This commit is contained in:
@ -392,10 +392,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
first second w c o e d t i r
|
||||
120 120 0 0 0 1 0 1 1 0
|
||||
120 120 1 1 0 1 0 1 1 1
|
||||
120 121 0 0 1 0 0 0 1 0
|
||||
121 120 0 0 1 0 0 0 1 0
|
||||
121 121 0 0 0 1 0 1 1 0
|
||||
121 121 1 1 0 1 0 1 1 1
|
||||
explain extended SELECT g1.fid as first, g2.fid as second,
|
||||
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
|
||||
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
@ -494,12 +494,13 @@ mbroverlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrtouches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrwithin
|
||||
big,center
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
contains
|
||||
center,small
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
disjoint
|
||||
down3,left3,right3,up3
|
||||
@ -514,9 +515,10 @@ overlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
touches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
within
|
||||
big,center
|
||||
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
|
||||
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
|
||||
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
|
||||
|
@ -79,7 +79,7 @@ select 1, ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('
|
||||
1 1
|
||||
select 0, ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(16 16, 51 51)'));
|
||||
0 ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(16 16, 51 51)'))
|
||||
0 0
|
||||
0 1
|
||||
select 1, ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'));
|
||||
1 ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))
|
||||
1 1
|
||||
@ -127,10 +127,10 @@ astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFr
|
||||
POLYGON((26.4705882352941 23.8235294117647,21.9512195121951 27.4390243902439,23.855421686747 29.8192771084337,29.2899408284024 26.3609467455621,26.4705882352941 23.8235294117647))
|
||||
select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)')));
|
||||
astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)')))
|
||||
MULTIPOINT(26.4705882352941 23.8235294117647,29.2899408284024 26.3609467455621,21.9512195121951 27.4390243902439,23.855421686747 29.8192771084337)
|
||||
MULTIPOINT(23.8235294117647 26.4705882352941,26.3609467455621 29.2899408284024,27.4390243902439 21.9512195121951,29.8192771084337 23.855421686747)
|
||||
select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)')));
|
||||
astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)')))
|
||||
POINT(29.2899408284024 26.3609467455621)
|
||||
POINT(26.3609467455621 29.2899408284024)
|
||||
select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)')));
|
||||
astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)')))
|
||||
POINT(20 20)
|
||||
@ -148,7 +148,7 @@ astext(ST_intersection(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromte
|
||||
POLYGON((0 0,0 1,0.5 0.5,0 0))
|
||||
select astext(ST_symdifference(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))')));
|
||||
astext(ST_symdifference(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))')))
|
||||
MULTIPOLYGON(((0 0,0 1,0 0,0.5 0.5,1 0,0 0)),((0.5 0.5,0 1,0 2,1 1,0.5 0.5)))
|
||||
MULTIPOLYGON(((0 0,0.5 0.5,1 0,0 0)),((0.5 0.5,0 1,0 2,1 1,0.5 0.5)))
|
||||
select astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)')));
|
||||
astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)')))
|
||||
GEOMETRYCOLLECTION(LINESTRING(-10 -10,0 0),LINESTRING(-11 -9,8 10),POLYGON((0 0,40 50,50 45,0 0)),LINESTRING(46.6666666666667 46.6666666666667,200 200,199 201,45.3333333333333 47.3333333333333))
|
||||
@ -189,7 +189,7 @@ st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1
|
||||
0
|
||||
select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))'));
|
||||
st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))'))
|
||||
0
|
||||
1
|
||||
select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))'));
|
||||
st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))'))
|
||||
1
|
||||
@ -208,13 +208,13 @@ ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0,
|
||||
astext(ST_UNION (
|
||||
PolyFromText('POLYGON(( 2 2 ,3 2,2 7,2 2),( 0 0,8 2,1 9,0 0))'),
|
||||
ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0,0 5))')))))
|
||||
GEOMETRYCOLLECTION(POLYGON((0 0,1 9,8 2,0 0),(2 2,2 7,3 2,2 2)),LINESTRING(0 0,5 0,5 1.25),LINESTRING(0 0,0 5,0.555555555555556 5),LINESTRING(2.4 5,2 5))
|
||||
GEOMETRYCOLLECTION(POLYGON((0 0,1 9,8 2,0 0),(2 2,2 7,3 2,2 2)),LINESTRING(0.555555555555556 5,0 5,0 0,5 0,5 1.25),LINESTRING(2 5,2.4 5))
|
||||
SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0));
|
||||
astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0))
|
||||
LINESTRING(0 0,1 1)
|
||||
SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5);
|
||||
Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5)
|
||||
78.68426
|
||||
78.68303
|
||||
SELECT ST_INTERSECTION(NULL, NULL);
|
||||
ST_INTERSECTION(NULL, NULL)
|
||||
NULL
|
||||
@ -231,7 +231,7 @@ MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4))
|
||||
((0 5,3 5,3 0,0 0,0 1,2 1,2 2,0 2,0 5), (1 3,2 3,2 4,1 4,1 3)),
|
||||
((2 2,5 2,4 4,2 8,2 2)))'),
|
||||
MULTIPOLY
|
||||
MULTIPOLYGON(((2 2,3 2,2 2)),((5 2,0 2,5 2)),((2 2,0 2,1.5 5,2 5,2 2),(1 3,1 4,2 4,2 3,1 3)),((2 2,2 8,8 8,8 2,5 2,2 2),(6 4,4 4,4 6,6 6,6 4)))
|
||||
POLYGON((0 2,1 4,1 3,2 3,2 4,1 4,1.5 5,2 5,2 8,8 8,8 2,0 2),(4 4,4 6,6 6,6 4,4 4))
|
||||
SELECT ASTEXT(ST_UNION(
|
||||
MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0),
|
||||
(8 2,1 3,9 0,4 4))'),
|
||||
@ -240,7 +240,7 @@ ASTEXT(ST_UNION(
|
||||
MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0),
|
||||
(8 2,1 3,9 0,4 4))'),
|
||||
MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 5,6 7,9 7,5 2,1 6,3 6))')))
|
||||
MULTILINESTRING((8 2,1 3,9 0,4 4),(5 0,2 9,8 4,3 7,0 7,3 9,6 4,4 3,3 6,3 5,4 0,6 2),(3 6,1 6,5 2,9 7,6 7,2 5))
|
||||
MULTILINESTRING((3.59459459459459 2.02702702702703,4 0,4.75 0.75),(5 0,4.75 0.75),(5.36363636363636 1.36363636363636,9 0,6.17391304347826 2.26086956521739),(4.75 0.75,4.42857142857143 1.71428571428571),(4.75 0.75,5.36363636363636 1.36363636363636),(5.36363636363636 1.36363636363636,4.42857142857143 1.71428571428571),(5.36363636363636 1.36363636363636,6 2),(4.42857142857143 1.71428571428571,3.59459459459459 2.02702702702703),(4.42857142857143 1.71428571428571,4.15 2.55),(4.5 2.5,5 2,5.30769230769231 2.38461538461538),(8 2,6.17391304347826 2.26086956521739),(3.59459459459459 2.02702702702703,1 3,3.47058823529412 2.64705882352941),(3.59459459459459 2.02702702702703,3.47058823529412 2.64705882352941),(6.17391304347826 2.26086956521739,5.30769230769231 2.38461538461538),(6.17391304347826 2.26086956521739,5.58536585365854 2.73170731707317),(5.30769230769231 2.38461538461538,4.5 2.5),(5.30769230769231 2.38461538461538,5.58536585365854 2.73170731707317),(4.5 2.5,4.15 2.55),(4.5 2.5,4 3),(4.15 2.55,3.47058823529412 2.64705882352941),(4.15 2.55,4 3),(3.47058823529412 2.64705882352941,3.25 3.75),(5.58536585365854 2.73170731707317,4.76923076923077 3.38461538461538),(5.58536585365854 2.73170731707317,7.05405405405405 4.56756756756757),(4 3,3.25 3.75),(4 3,3.14285714285714 5.57142857142857),(4 3,4.76923076923077 3.38461538461538),(4.76923076923077 3.38461538461538,4 4),(4.76923076923077 3.38461538461538,6 4,4.875 5.875),(3.25 3.75,2 5),(3.25 3.75,3 5,3 5.5),(7.05405405405405 4.56756756756757,8 4,7.16 4.7),(7.05405405405405 4.56756756756757,4.875 5.875),(7.05405405405405 4.56756756756757,7.16 4.7),(7.16 4.7,5 6.5),(7.16 4.7,9 7,6 7,5 6.5),(2 5,1 6,3 6),(2 5,3 5.5),(3 5.5,3 6),(3 5.5,3.14285714285714 5.57142857142857),(3.14285714285714 5.57142857142857,3 6),(3.14285714285714 5.57142857142857,4.36363636363636 6.18181818181818),(4.875 5.875,4.36363636363636 6.18181818181818),(4.875 5.875,4.61538461538461 6.30769230769231),(3 6,2.66666666666667 7),(4.36363636363636 6.18181818181818,3 7,2.66666666666667 7),(4.36363636363636 6.18181818181818,4.61538461538461 6.30769230769231),(4.61538461538461 6.30769230769231,4 7.33333333333333),(4.61538461538461 6.30769230769231,5 6.5),(5 6.5,4 7.33333333333333),(2.18181818181818 8.45454545454546,0 7,2.66666666666667 7),(2.66666666666667 7,2.18181818181818 8.45454545454546),(4 7.33333333333333,2.44444444444444 8.62962962962963),(4 7.33333333333333,3 9,2.44444444444444 8.62962962962963),(2.18181818181818 8.45454545454546,2 9,2.44444444444444 8.62962962962963),(2.18181818181818 8.45454545454546,2.44444444444444 8.62962962962963))
|
||||
SELECT ST_NUMGEOMETRIES((ST_UNION(ST_UNION(
|
||||
MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8),
|
||||
(6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0),
|
||||
@ -257,14 +257,14 @@ ST_NUMGEOMETRIES((ST_UNION(ST_UNION(
|
||||
MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8),
|
||||
(6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0),
|
||||
|
||||
32
|
||||
183
|
||||
SELECT Round(ST_AREA(ST_BUFFER( ST_UNION(
|
||||
POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'),
|
||||
POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6);
|
||||
Round(ST_AREA(ST_BUFFER( ST_UNION(
|
||||
POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'),
|
||||
POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6)
|
||||
21.901403
|
||||
21.901344
|
||||
SELECT AsText(ST_UNION(MultiPolygonFromText('
|
||||
MULTIPOLYGON(((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)),
|
||||
((0 0, 8 3, 7 4, 0 0)),
|
||||
@ -278,7 +278,7 @@ AsText(ST_UNION(MultiPolygonFromText('
|
||||
((0 0, 8 3, 7 4, 0 0)),
|
||||
((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)))'),
|
||||
MultiPolygonFr
|
||||
POLYGON((0 0,0 5,0.555555555555556 5,1 9,2 8,8 8,8 2,7 2,5.33333333333333 2,3 1.125,3 0,0 0),(1 1,1 1.5,1.33333333333333 2,1 2,2 2,2 1.14285714285714,1.75 1,1 1),(3 1.71428571428571,3 2,3.5 2,3 1.71428571428571),(4 4,4 6,4.5 6,5.5 4,4 4))
|
||||
POLYGON((0 0,0 5,0.555555555555556 5,1 9,2 8,8 8,8 2,5.33333333333333 2,3 1.125,3 0,0 0),(1 1,1 1.5,1.33333333333333 2,2 2,2 1.14285714285714,1.75 1,1 1),(3 1.71428571428571,3 2,3.5 2,3 1.71428571428571),(4 4,4 6,4.5 6,5.5 4,4 4))
|
||||
SELECT AsText(ST_SYMDIFFERENCE(
|
||||
MultiLineStringFromText('MULTILINESTRING((7 7, 1 7, 8 5, 7 8, 7 7),
|
||||
(6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'),
|
||||
@ -287,7 +287,7 @@ AsText(ST_SYMDIFFERENCE(
|
||||
MultiLineStringFromText('MULTILINESTRING((7 7, 1 7, 8 5, 7 8, 7 7),
|
||||
(6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'),
|
||||
Envelope(GeometryFromText('MULTIPOINT(7 9, 0 0, 3 7, 1 6, 0 0)'))))
|
||||
GEOMETRYCOLLECTION(LINESTRING(9 9,8 4,9 0,9 9,7 7),POLYGON((0 0,0 9,7 9,7 0,0 0)),LINESTRING(7 5.28571428571429,8 5,7 8))
|
||||
GEOMETRYCOLLECTION(POLYGON((0 0,0 9,7 9,7 0,0 0)),LINESTRING(9 9,8 4,9 0,9 9),LINESTRING(7 5.28571428571429,8 5,7.25 7.25),LINESTRING(7 7,7.25 7.25),LINESTRING(7.25 7.25,7 8),LINESTRING(7.25 7.25,9 9))
|
||||
SELECT AsText(ST_UNION(
|
||||
MultiPolygonFromText('MULTIPOLYGON(((9 9, 7 9, 1 1, 9 9)),
|
||||
((2 2, 1 2, 3 3, 2 2, 2 2)),
|
||||
|
@ -170,6 +170,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range g g 34 NULL 8 Using where
|
||||
SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))'));
|
||||
fid AsText(g)
|
||||
11 LINESTRING(140 140,160 160)
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t2 (
|
||||
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
|
@ -384,10 +384,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
first second w c o e d t i r
|
||||
120 120 0 0 0 1 0 1 1 0
|
||||
120 120 1 1 0 1 0 1 1 1
|
||||
120 121 0 0 1 0 0 0 1 0
|
||||
121 120 0 0 1 0 0 0 1 0
|
||||
121 121 0 0 0 1 0 1 1 0
|
||||
121 121 1 1 0 1 0 1 1 1
|
||||
explain extended SELECT g1.fid as first, g2.fid as second,
|
||||
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
|
||||
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
@ -835,12 +835,13 @@ mbroverlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrtouches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrwithin
|
||||
big,center
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
contains
|
||||
center,small
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
disjoint
|
||||
down3,left3,right3,up3
|
||||
@ -855,9 +856,10 @@ overlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
touches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
within
|
||||
big,center
|
||||
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
|
||||
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
|
||||
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
|
||||
@ -1410,7 +1412,7 @@ FROM lakes, named_places
|
||||
WHERE lakes.name = 'Blue Lake'
|
||||
AND named_places.name = 'Ashton';
|
||||
AsText(ST_SymDifference(shore, boundary))
|
||||
MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(67 13,59 13,59 18,67 18,67 13)),((56 30,56 34,62 48,84 48,84 30,56 30)))
|
||||
MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30)))
|
||||
# Conformance Item T51
|
||||
SELECT count(*)
|
||||
FROM buildings, bridges
|
||||
|
@ -392,10 +392,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
first second w c o e d t i r
|
||||
120 120 0 0 0 1 0 1 1 0
|
||||
120 120 1 1 0 1 0 1 1 1
|
||||
120 121 0 0 1 0 0 0 1 0
|
||||
121 120 0 0 1 0 0 0 1 0
|
||||
121 121 0 0 0 1 0 1 1 0
|
||||
121 121 1 1 0 1 0 1 1 1
|
||||
explain extended SELECT g1.fid as first, g2.fid as second,
|
||||
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
|
||||
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
@ -494,12 +494,13 @@ mbroverlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrtouches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrwithin
|
||||
big,center
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
contains
|
||||
center,small
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
disjoint
|
||||
down3,left3,right3,up3
|
||||
@ -514,9 +515,10 @@ overlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
touches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
within
|
||||
big,center
|
||||
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
|
||||
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
|
||||
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
|
||||
|
@ -392,10 +392,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
first second w c o e d t i r
|
||||
120 120 0 0 0 1 0 1 1 0
|
||||
120 120 1 1 0 1 0 1 1 1
|
||||
120 121 0 0 1 0 0 0 1 0
|
||||
121 120 0 0 1 0 0 0 1 0
|
||||
121 121 0 0 0 1 0 1 1 0
|
||||
121 121 1 1 0 1 0 1 1 1
|
||||
explain extended SELECT g1.fid as first, g2.fid as second,
|
||||
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
|
||||
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
@ -494,12 +494,13 @@ mbroverlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrtouches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrwithin
|
||||
big,center
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
contains
|
||||
center,small
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
disjoint
|
||||
down3,left3,right3,up3
|
||||
@ -514,9 +515,10 @@ overlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
touches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
within
|
||||
big,center
|
||||
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
|
||||
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
|
||||
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
|
||||
|
@ -181,6 +181,7 @@ fid AsText(g)
|
||||
8 LINESTRING(143 143,157 157)
|
||||
9 LINESTRING(142 142,158 158)
|
||||
10 LINESTRING(141 141,159 159)
|
||||
11 LINESTRING(140 140,160 160)
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t2 (
|
||||
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
@ -308,403 +309,403 @@ fid AsText(g)
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
99
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
98
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
97
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
96
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
95
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
94
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
93
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
92
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
91
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
90
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
89
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
88
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
87
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
86
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
85
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
84
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
83
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
82
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
81
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
80
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
79
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
78
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
77
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
76
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
75
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
74
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
73
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
72
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
71
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
70
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
69
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
68
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
67
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
66
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
65
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
64
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
63
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
62
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
61
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
60
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
59
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
58
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
57
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
56
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
55
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
54
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
53
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
52
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
51
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
50
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
49
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
48
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
47
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
46
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
45
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
44
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
43
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
42
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
41
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
40
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
39
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
38
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
37
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
36
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
35
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
34
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
33
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
32
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
31
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
30
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
29
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
28
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
27
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
26
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
25
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
24
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
23
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
22
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
21
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
20
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
19
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
18
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
17
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
16
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
15
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
14
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
13
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
12
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
11
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
10
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
9
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
8
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
7
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
6
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
5
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
4
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
3
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
2
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
1
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
0
|
||||
DROP TABLE t2;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
|
@ -181,6 +181,7 @@ fid AsText(g)
|
||||
8 LINESTRING(143 143,157 157)
|
||||
9 LINESTRING(142 142,158 158)
|
||||
10 LINESTRING(141 141,159 159)
|
||||
11 LINESTRING(140 140,160 160)
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t2 (
|
||||
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
@ -308,403 +309,403 @@ fid AsText(g)
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
99
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
98
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
97
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
96
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
95
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
94
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
93
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
92
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
91
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
90
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
89
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
88
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
87
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
86
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
85
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
84
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
83
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
82
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
81
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
80
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
79
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
78
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
77
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
76
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
75
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
74
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
73
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
72
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
71
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
70
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
69
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
68
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
67
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
66
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
65
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
64
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
63
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
62
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
61
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
60
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
59
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
58
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
57
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
56
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
55
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
54
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
53
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
52
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
51
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
50
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
49
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
48
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
47
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
46
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
45
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
44
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
43
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
42
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
41
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
40
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
39
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
38
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
37
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
36
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
35
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
34
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
33
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
32
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
31
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
30
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
29
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
28
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
27
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
26
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
25
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
24
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
23
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
22
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
21
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
20
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
19
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
18
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
17
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
16
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
15
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
14
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
13
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
12
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
11
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
10
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
9
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
8
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
7
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
6
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
5
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
4
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
3
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
2
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
1
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
0
|
||||
DROP TABLE t2;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
|
@ -181,6 +181,7 @@ fid AsText(g)
|
||||
8 LINESTRING(143 143,157 157)
|
||||
9 LINESTRING(142 142,158 158)
|
||||
10 LINESTRING(141 141,159 159)
|
||||
11 LINESTRING(140 140,160 160)
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t2 (
|
||||
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
@ -308,403 +309,403 @@ fid AsText(g)
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
99
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
98
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
97
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
96
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
95
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
94
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
93
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
92
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
91
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
90
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
89
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
88
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
87
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
86
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
85
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
84
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
83
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
82
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
81
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
80
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
79
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
78
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
77
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
76
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
75
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
74
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
73
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
72
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
71
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
70
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
69
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
68
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
67
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
66
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
65
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
64
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
63
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
62
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
61
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
60
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
59
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
58
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
57
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
56
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
55
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
54
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
53
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
52
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
51
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
50
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
49
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
48
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
47
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
46
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
45
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
44
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
43
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
42
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
41
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
40
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
39
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
38
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
37
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
36
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
35
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
34
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
33
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
32
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
31
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
30
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
29
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
28
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
27
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
26
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
25
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
24
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
23
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
22
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
21
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
20
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
19
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
18
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
17
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
16
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
15
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
14
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
13
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
12
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
11
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
10
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
9
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
8
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
7
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
6
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
5
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
4
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
3
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
2
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
1
|
||||
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)))));
|
||||
SELECT count(*) FROM t2;
|
||||
count(*)
|
||||
100
|
||||
0
|
||||
DROP TABLE t2;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#define PH_DATA_OFFSET 8
|
||||
#define coord_to_float(d) ((double) d)
|
||||
#define coord_eq(a, b) (a == b)
|
||||
|
||||
typedef int (*sc_compare_func)(const void*, const void*);
|
||||
|
||||
@ -126,28 +127,13 @@ static inline void trim_node(Gcalc_heap::Info *node, Gcalc_heap::Info *prev_node
|
||||
}
|
||||
|
||||
|
||||
static double find_first_different(const Gcalc_heap::Info *p)
|
||||
{
|
||||
if (p->left && (p->left->y != p->y))
|
||||
return p->left->y;
|
||||
if (p->right && (p->right->y != p->y))
|
||||
return p->right->y;
|
||||
if (p->left && p->left->left && (p->left->left->y != p->y))
|
||||
return p->left->left->y;
|
||||
if (p->right && p->right->right && (p->right->right->y != p->y))
|
||||
return p->right->right->y;
|
||||
|
||||
return p->y;
|
||||
}
|
||||
|
||||
|
||||
static int compare_point_info(const void *e0, const void *e1)
|
||||
{
|
||||
const Gcalc_heap::Info *i0= (const Gcalc_heap::Info *)e0;
|
||||
const Gcalc_heap::Info *i1= (const Gcalc_heap::Info *)e1;
|
||||
if (i0->y != i1->y)
|
||||
if (!coord_eq(i0->y, i1->y))
|
||||
return i0->y > i1->y;
|
||||
return find_first_different(i0) > find_first_different(i1);
|
||||
return i0->x > i1->x;
|
||||
}
|
||||
|
||||
|
||||
@ -197,6 +183,8 @@ int Gcalc_shape_transporter::int_add_point(gcalc_shape_info Info,
|
||||
double x, double y)
|
||||
{
|
||||
Gcalc_heap::Info *point;
|
||||
DBUG_ASSERT(!m_prev || m_prev->x != x || m_prev->y != y);
|
||||
|
||||
if (!(point= m_heap->new_point_info(x, y, Info)))
|
||||
return 1;
|
||||
if (m_first)
|
||||
@ -234,6 +222,7 @@ void Gcalc_shape_transporter::int_complete()
|
||||
return;
|
||||
}
|
||||
|
||||
DBUG_ASSERT(m_prev->x != m_first->x || m_prev->y != m_first->y);
|
||||
/* polygon */
|
||||
m_first->right= m_prev;
|
||||
m_prev->left= m_first;
|
||||
@ -253,15 +242,14 @@ inline int GET_DX_DY(double *dxdy,
|
||||
Gcalc_scan_iterator::Gcalc_scan_iterator(size_t blk_size) :
|
||||
Gcalc_dyn_list(blk_size,
|
||||
(sizeof(point) > sizeof(intersection)) ?
|
||||
sizeof(point) : sizeof(intersection)),
|
||||
m_slice0(NULL), m_slice1(NULL)
|
||||
sizeof(point) : sizeof(intersection))
|
||||
{}
|
||||
|
||||
Gcalc_scan_iterator::point
|
||||
*Gcalc_scan_iterator::new_slice(Gcalc_scan_iterator::point *example)
|
||||
{
|
||||
point *result= NULL;
|
||||
Gcalc_dyn_list::Item **result_hook= (Gcalc_dyn_list::Item **)&result;
|
||||
Gcalc_dyn_list::Item **result_hook= (Gcalc_dyn_list::Item **) &result;
|
||||
while (example)
|
||||
{
|
||||
*result_hook= new_slice_point();
|
||||
@ -276,55 +264,156 @@ Gcalc_scan_iterator::point
|
||||
void Gcalc_scan_iterator::init(Gcalc_heap *points)
|
||||
{
|
||||
DBUG_ASSERT(points->ready());
|
||||
DBUG_ASSERT(!m_slice0 && !m_slice1);
|
||||
DBUG_ASSERT(!state0.slice && !state1.slice);
|
||||
|
||||
if (!(m_cur_pi= points->get_first()))
|
||||
return;
|
||||
m_cur_thread= 0;
|
||||
m_sav_slice= NULL;
|
||||
m_intersections= NULL;
|
||||
m_cur_intersection= NULL;
|
||||
m_y1= m_cur_pi->y;
|
||||
m_next_is_top_point= true;
|
||||
m_bottom_points_count= 0;
|
||||
m_events= NULL;
|
||||
current_state= &state0;
|
||||
next_state= &state1;
|
||||
saved_state= &state_s;
|
||||
next_state->y= m_cur_pi->y;
|
||||
}
|
||||
|
||||
void Gcalc_scan_iterator::reset()
|
||||
{
|
||||
if (m_slice0)
|
||||
free_list(m_slice0);
|
||||
if (m_slice1)
|
||||
free_list(m_slice1);
|
||||
m_slice0= m_slice1= NULL;
|
||||
state0.slice= state1.slice= m_events= state_s.slice= NULL;
|
||||
m_intersections= NULL;
|
||||
Gcalc_dyn_list::reset();
|
||||
}
|
||||
|
||||
static bool slice_first_equal_x(const Gcalc_scan_iterator::point *p0,
|
||||
const Gcalc_scan_iterator::point *p1)
|
||||
|
||||
void Gcalc_scan_iterator::point::copy_core(point *from)
|
||||
{
|
||||
if (p0->horiz_dir == p1->horiz_dir)
|
||||
return p0->dx_dy <= p1->dx_dy;
|
||||
if (p0->horiz_dir)
|
||||
return p0->dx_dy < 0;
|
||||
return p1->dx_dy > 0; /* p1->horiz_dir case */
|
||||
dx_dy= from->dx_dy;
|
||||
horiz_dir= from->horiz_dir;
|
||||
pi= from->pi;
|
||||
next_pi= from->next_pi;
|
||||
thread= from->thread;
|
||||
#ifdef TO_REMOVE
|
||||
from->next_link= this;
|
||||
#endif /*TO_REMOVE*/
|
||||
}
|
||||
|
||||
|
||||
static inline bool slice_first(const Gcalc_scan_iterator::point *p0,
|
||||
const Gcalc_scan_iterator::point *p1)
|
||||
int Gcalc_scan_iterator::point::compare_dx_dy(int horiz_dir_a, double dx_dy_a,
|
||||
int horiz_dir_b, double dx_dy_b)
|
||||
{
|
||||
if (p0->x != p1->x)
|
||||
return p0->x < p1->x;
|
||||
return slice_first_equal_x(p0, p1);
|
||||
if (!horiz_dir_a && !horiz_dir_b)
|
||||
{
|
||||
if (coord_eq(dx_dy_a, dx_dy_b))
|
||||
return 0;
|
||||
return dx_dy_a < dx_dy_b ? -1 : 1;
|
||||
}
|
||||
if (!horiz_dir_a)
|
||||
return -1;
|
||||
if (!horiz_dir_b)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Gcalc_scan_iterator::point::cmp_dx_dy(const point *p) const
|
||||
{
|
||||
if (is_bottom())
|
||||
return p->is_bottom() ? 0 : -1;
|
||||
if (p->is_bottom())
|
||||
return 1;
|
||||
return compare_dx_dy(horiz_dir, dx_dy, p->horiz_dir, p->dx_dy);
|
||||
}
|
||||
|
||||
|
||||
void Gcalc_scan_iterator::mark_event_position1(
|
||||
point *ep, Gcalc_dyn_list::Item **ep_hook)
|
||||
{
|
||||
if (!next_state->event_position)
|
||||
{
|
||||
next_state->event_position= ep;
|
||||
next_state->event_position_hook= ep_hook;
|
||||
}
|
||||
next_state->event_end_hook= &ep->next;
|
||||
}
|
||||
|
||||
|
||||
static int compare_events(const void *e0, const void *e1)
|
||||
{
|
||||
const Gcalc_scan_iterator::point *p0= (const Gcalc_scan_iterator::point *)e0;
|
||||
const Gcalc_scan_iterator::point *p1= (const Gcalc_scan_iterator::point *)e1;
|
||||
return p0->cmp_dx_dy(p1) > 0;
|
||||
}
|
||||
|
||||
|
||||
int Gcalc_scan_iterator::arrange_event()
|
||||
{
|
||||
int ev_counter;
|
||||
point *sp, *new_sp;
|
||||
point *after_event;
|
||||
Gcalc_dyn_list::Item **ae_hook= (Gcalc_dyn_list::Item **) &after_event;
|
||||
|
||||
if (m_events)
|
||||
free_list(m_events);
|
||||
ev_counter= 0;
|
||||
DBUG_ASSERT(current_state->event_position ==
|
||||
*current_state->event_position_hook);
|
||||
for (sp= current_state->event_position;
|
||||
sp != *current_state->event_end_hook; sp= sp->get_next())
|
||||
{
|
||||
if (sp->is_bottom())
|
||||
continue;
|
||||
if (!(new_sp= new_slice_point()))
|
||||
return 1;
|
||||
*new_sp= *sp;
|
||||
*ae_hook= new_sp;
|
||||
ae_hook= &new_sp->next;
|
||||
#ifdef TO_REMOVE
|
||||
sp->intersection_link= new_sp;
|
||||
#endif /*TO_REMOVE*/
|
||||
ev_counter++;
|
||||
}
|
||||
*ae_hook= NULL;
|
||||
m_events= current_state->event_position;
|
||||
if (after_event)
|
||||
{
|
||||
if (after_event->get_next())
|
||||
{
|
||||
point *cur_p;
|
||||
after_event= (point *) sort_list(compare_events, after_event, ev_counter);
|
||||
/* Find last item in the list, ae_hook can change after the sorting */
|
||||
for (cur_p= after_event->get_next(); cur_p->get_next();
|
||||
cur_p= cur_p->get_next());
|
||||
ae_hook= &cur_p->next;
|
||||
|
||||
}
|
||||
*ae_hook= *current_state->event_end_hook;
|
||||
*current_state->event_end_hook= NULL;
|
||||
*current_state->event_position_hook= after_event;
|
||||
current_state->event_end_hook= ae_hook;
|
||||
current_state->event_position= after_event;
|
||||
}
|
||||
else
|
||||
{
|
||||
*current_state->event_position_hook= *current_state->event_end_hook;
|
||||
*current_state->event_end_hook= NULL;
|
||||
current_state->event_position= sp;
|
||||
current_state->event_end_hook= current_state->event_position_hook;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Gcalc_scan_iterator::insert_top_point()
|
||||
{
|
||||
point *sp= m_slice1;
|
||||
Gcalc_dyn_list::Item **prev_hook= (Gcalc_dyn_list::Item **)&m_slice1;
|
||||
point *sp= next_state->slice;
|
||||
Gcalc_dyn_list::Item **prev_hook=
|
||||
(Gcalc_dyn_list::Item **) &next_state->slice;
|
||||
point *sp1;
|
||||
point *sp0= new_slice_point();
|
||||
point *sp_inc;
|
||||
|
||||
if (!sp0)
|
||||
return 1;
|
||||
@ -335,116 +424,182 @@ int Gcalc_scan_iterator::insert_top_point()
|
||||
if (m_cur_pi->left)
|
||||
{
|
||||
sp0->horiz_dir= GET_DX_DY(&sp0->dx_dy, m_cur_pi, m_cur_pi->left);
|
||||
m_event1= scev_thread;
|
||||
sp0->event= scev_thread;
|
||||
|
||||
/*Now just to increase the size of m_slice0 to be same*/
|
||||
if (!(sp1= new_slice_point()))
|
||||
if (!(sp_inc= new_slice_point()))
|
||||
return 1;
|
||||
sp1->next= m_slice0;
|
||||
m_slice0= sp1;
|
||||
sp_inc->next= current_state->slice;
|
||||
current_state->slice= sp_inc;
|
||||
if (m_cur_pi->right)
|
||||
{
|
||||
if (!(sp1= new_slice_point()))
|
||||
return 1;
|
||||
sp1->event= sp0->event= scev_two_threads;
|
||||
#ifdef TO_REMOVE
|
||||
sp1->event_pair= sp0;
|
||||
sp0->event_pair= sp1;
|
||||
#endif /*TO_REMOVE*/
|
||||
sp1->pi= m_cur_pi;
|
||||
sp1->next_pi= m_cur_pi->right;
|
||||
sp1->thread= m_cur_thread++;
|
||||
sp1->x= sp0->x;
|
||||
sp1->horiz_dir= GET_DX_DY(&sp1->dx_dy, m_cur_pi, m_cur_pi->right);
|
||||
/* We have two threads so should decide which one will be first */
|
||||
if (sp0->cmp_dx_dy(sp1)>0)
|
||||
{
|
||||
point *tmp= sp0;
|
||||
sp0= sp1;
|
||||
sp1= tmp;
|
||||
}
|
||||
|
||||
/*Now just to increase the size of m_slice0 to be same*/
|
||||
if (!(sp_inc= new_slice_point()))
|
||||
return 1;
|
||||
sp_inc->next= current_state->slice;
|
||||
current_state->slice= sp_inc;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_event1= scev_single_point;
|
||||
sp0->event= scev_single_point;
|
||||
sp0->horiz_dir= 0;
|
||||
sp0->dx_dy= 0.0;
|
||||
}
|
||||
|
||||
/* First we need to find the place to insert.
|
||||
Binary search could probably make things faster here,
|
||||
but structures used aren't suitable, and the
|
||||
scan is usually not really long */
|
||||
for (; sp && slice_first(sp, sp0);
|
||||
prev_hook= &sp->next, sp=sp->get_next())
|
||||
|
||||
/* We need to find the place to insert. */
|
||||
for (; sp && (sp->x < sp0->x); prev_hook= &sp->next, sp=sp->get_next())
|
||||
{}
|
||||
|
||||
if (m_cur_pi->right)
|
||||
next_state->event_position_hook= prev_hook;
|
||||
if (sp && coord_eq(sp->x, sp0->x))
|
||||
{
|
||||
m_event1= scev_two_threads;
|
||||
/*We have two threads so should decide which one will be first*/
|
||||
sp1= new_slice_point();
|
||||
if (!sp1)
|
||||
return 1;
|
||||
sp1->pi= m_cur_pi;
|
||||
sp1->next_pi= m_cur_pi->right;
|
||||
sp1->thread= m_cur_thread++;
|
||||
sp1->x= sp0->x;
|
||||
sp1->horiz_dir= GET_DX_DY(&sp1->dx_dy, m_cur_pi, m_cur_pi->right);
|
||||
if (slice_first_equal_x(sp1, sp0))
|
||||
next_state->event_position= sp;
|
||||
do
|
||||
{
|
||||
point *tmp= sp0;
|
||||
sp0= sp1;
|
||||
sp1= tmp;
|
||||
}
|
||||
sp1->next= sp;
|
||||
sp0->next= sp1;
|
||||
|
||||
/*Now just to increase the size of m_slice0 to be same*/
|
||||
if (!(sp1= new_slice_point()))
|
||||
return 1;
|
||||
sp1->next= m_slice0;
|
||||
m_slice0= sp1;
|
||||
if (!sp->event)
|
||||
sp->event= scev_intersection;
|
||||
prev_hook= &sp->next;
|
||||
sp= sp->get_next();
|
||||
} while (sp && coord_eq(sp->x, sp0->x));
|
||||
}
|
||||
else
|
||||
sp0->next= sp;
|
||||
next_state->event_position= sp0;
|
||||
|
||||
*prev_hook= sp0;
|
||||
m_event_position1= sp0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
intersection_normal= 1,
|
||||
intersection_forced= 2
|
||||
};
|
||||
|
||||
|
||||
static int intersection_found(const Gcalc_scan_iterator::point *sp0,
|
||||
const Gcalc_scan_iterator::point *sp1,
|
||||
unsigned int bottom_points_count)
|
||||
{
|
||||
if (sp1->x < sp0->x)
|
||||
return intersection_normal;
|
||||
if (sp1->is_bottom() && !sp0->is_bottom() &&
|
||||
(bottom_points_count > 1))
|
||||
return intersection_forced;
|
||||
if (sp0->event == scev_two_threads)
|
||||
{
|
||||
sp1->next= sp;
|
||||
sp0->next= sp1;
|
||||
next_state->event_end_hook= &sp1->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
sp0->next= sp;
|
||||
next_state->event_end_hook= &sp0->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Gcalc_scan_iterator::normal_scan()
|
||||
{
|
||||
if (m_next_is_top_point)
|
||||
if (insert_top_point())
|
||||
return 1;
|
||||
point *sp;
|
||||
Gcalc_dyn_list::Item **sp_hook;
|
||||
Gcalc_heap::Info *next_pi;
|
||||
point *first_bottom_point= NULL;
|
||||
|
||||
point *tmp= m_slice0;
|
||||
m_slice0= m_slice1;
|
||||
m_slice1= tmp;
|
||||
m_event0= m_event1;
|
||||
m_event_position0= m_event_position1;
|
||||
m_y0= m_y1;
|
||||
if (m_next_is_top_point && insert_top_point())
|
||||
return 1;
|
||||
|
||||
if (!(m_cur_pi= m_cur_pi->get_next()))
|
||||
for (next_pi= m_cur_pi->get_next();
|
||||
next_pi &&
|
||||
coord_eq(m_cur_pi->x, next_pi->x) &&
|
||||
coord_eq(m_cur_pi->y, next_pi->y);
|
||||
next_pi= next_pi->get_next())
|
||||
{
|
||||
free_list(m_slice1);
|
||||
m_slice1= NULL;
|
||||
DBUG_ASSERT(coord_eq(next_state->event_position->x, next_pi->x));
|
||||
next_state->clear_event_position();
|
||||
m_next_is_top_point= true;
|
||||
for (sp= next_state->slice,
|
||||
sp_hook= (Gcalc_dyn_list::Item **) &next_state->slice; sp;
|
||||
sp_hook= &sp->next, sp= sp->get_next())
|
||||
{
|
||||
if (sp->next_pi == next_pi) /* End of the segment */
|
||||
{
|
||||
sp->x= coord_to_float(next_pi->x);
|
||||
sp->pi= next_pi;
|
||||
sp->next_pi= next_pi->left;
|
||||
m_next_is_top_point= false;
|
||||
if (next_pi->is_bottom())
|
||||
{
|
||||
if (first_bottom_point)
|
||||
{
|
||||
first_bottom_point->event= sp->event= scev_two_ends;
|
||||
#ifdef TO_REMOVE
|
||||
first_bottom_point->event_pair= sp;
|
||||
sp->event_pair= first_bottom_point;
|
||||
#endif /*TO_REMOVE*/
|
||||
}
|
||||
else
|
||||
{
|
||||
first_bottom_point= sp;
|
||||
sp->event= scev_end;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sp->event= scev_point;
|
||||
sp->horiz_dir= GET_DX_DY(&sp->dx_dy, next_pi, next_pi->left);
|
||||
}
|
||||
mark_event_position1(sp, sp_hook);
|
||||
}
|
||||
else if (coord_eq(sp->x, next_pi->x))
|
||||
{
|
||||
if (!sp->event)
|
||||
sp->event= scev_intersection;
|
||||
mark_event_position1(sp, sp_hook);
|
||||
}
|
||||
}
|
||||
m_cur_pi= next_pi;
|
||||
if (m_next_is_top_point && insert_top_point())
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Swap current <-> next */
|
||||
{
|
||||
slice_state *tmp= current_state;
|
||||
current_state= next_state;
|
||||
next_state= tmp;
|
||||
}
|
||||
|
||||
if (arrange_event())
|
||||
return 1;
|
||||
|
||||
point *sp0= current_state->slice;
|
||||
point *sp1= next_state->slice;
|
||||
point *prev_sp1= NULL;
|
||||
|
||||
if (!(m_cur_pi= next_pi))
|
||||
{
|
||||
free_list(sp1);
|
||||
next_state->slice= NULL;
|
||||
#ifdef TO_REMOVE
|
||||
for (; sp0; sp0= sp0->get_next())
|
||||
sp0->next_link= NULL;
|
||||
#endif /*TO_REMOVE*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
Gcalc_heap::Info *cur_pi= m_cur_pi;
|
||||
m_y1= coord_to_float(cur_pi->y);
|
||||
m_h= m_y1 - m_y0;
|
||||
next_state->y= coord_to_float(cur_pi->y);
|
||||
|
||||
point *sp0= m_slice0;
|
||||
point *sp1= m_slice1;
|
||||
point *prev_sp1= NULL;
|
||||
|
||||
m_bottom_points_count= 0;
|
||||
first_bottom_point= NULL;
|
||||
m_next_is_top_point= true;
|
||||
bool intersections_found= false;
|
||||
next_state->clear_event_position();
|
||||
|
||||
for (; sp0; sp0= sp0->get_next())
|
||||
{
|
||||
@ -454,41 +609,57 @@ int Gcalc_scan_iterator::normal_scan()
|
||||
sp1->pi= cur_pi;
|
||||
sp1->thread= sp0->thread;
|
||||
sp1->next_pi= cur_pi->left;
|
||||
if (cur_pi->left)
|
||||
sp1->horiz_dir= GET_DX_DY(&sp1->dx_dy, m_cur_pi, m_cur_pi->left);
|
||||
#ifdef TO_REMOVE
|
||||
sp0->next_link= sp1;
|
||||
#endif /*TO_REMOVE*/
|
||||
|
||||
m_next_is_top_point= false;
|
||||
|
||||
if (sp1->is_bottom())
|
||||
{
|
||||
++m_bottom_points_count;
|
||||
if (m_bottom_points_count == 1)
|
||||
if (!first_bottom_point)
|
||||
{
|
||||
m_event1= scev_end;
|
||||
m_event_position1= sp1;
|
||||
sp1->event= scev_end;
|
||||
first_bottom_point= sp1;
|
||||
}
|
||||
else
|
||||
m_event1= scev_two_ends;
|
||||
{
|
||||
first_bottom_point->event= sp1->event= scev_two_ends;
|
||||
#ifdef TO_REMOVE
|
||||
sp1->event_pair= first_bottom_point;
|
||||
first_bottom_point->event_pair= sp1;
|
||||
#endif /*TO_REMOVE*/
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_event1= scev_point;
|
||||
m_event_position1= sp1;
|
||||
sp1->event= scev_point;
|
||||
sp1->horiz_dir= GET_DX_DY(&sp1->dx_dy, m_cur_pi, m_cur_pi->left);
|
||||
}
|
||||
mark_event_position1(sp1,
|
||||
prev_sp1 ? &prev_sp1->next :
|
||||
(Gcalc_dyn_list::Item **) &next_state->slice);
|
||||
}
|
||||
else if (!sp0->is_bottom())
|
||||
else
|
||||
{
|
||||
/* Cut current string with the height of the new point*/
|
||||
sp1->copy_core(sp0);
|
||||
sp1->x= sp1->horiz_dir ? sp0->x :
|
||||
sp1->x= sp1->horiz_dir ? coord_to_float(cur_pi->x) :
|
||||
(coord_to_float(sp1->pi->x) +
|
||||
(m_y1-coord_to_float(sp1->pi->y)) * sp1->dx_dy);
|
||||
(next_state->y-coord_to_float(sp1->pi->y)) * sp1->dx_dy);
|
||||
if (coord_eq(sp1->x, cur_pi->x))
|
||||
{
|
||||
mark_event_position1(sp1,
|
||||
prev_sp1 ? &prev_sp1->next :
|
||||
(Gcalc_dyn_list::Item **) &next_state->slice);
|
||||
sp1->event= scev_intersection;
|
||||
}
|
||||
else
|
||||
sp1->event= scev_none;
|
||||
}
|
||||
else /* Skip the bottom point in slice0 */
|
||||
continue;
|
||||
|
||||
intersections_found= intersections_found ||
|
||||
(prev_sp1 && intersection_found(prev_sp1, sp1, m_bottom_points_count));
|
||||
(prev_sp1 && prev_sp1->x > sp1->x);
|
||||
|
||||
prev_sp1= sp1;
|
||||
sp1= sp1->get_next();
|
||||
@ -499,7 +670,7 @@ int Gcalc_scan_iterator::normal_scan()
|
||||
if (prev_sp1)
|
||||
prev_sp1->next= NULL;
|
||||
else
|
||||
m_slice1= NULL;
|
||||
next_state->slice= NULL;
|
||||
free_list(sp1);
|
||||
}
|
||||
|
||||
@ -513,7 +684,7 @@ int Gcalc_scan_iterator::normal_scan()
|
||||
#define INTERSECTION_ZERO 0.000000000001
|
||||
|
||||
int Gcalc_scan_iterator::add_intersection(const point *a, const point *b,
|
||||
int isc_kind, Gcalc_dyn_list::Item ***p_hook)
|
||||
Gcalc_dyn_list::Item ***p_hook)
|
||||
{
|
||||
intersection *isc= new_intersection();
|
||||
|
||||
@ -524,16 +695,12 @@ int Gcalc_scan_iterator::add_intersection(const point *a, const point *b,
|
||||
*p_hook= &isc->next;
|
||||
isc->thread_a= a->thread;
|
||||
isc->thread_b= b->thread;
|
||||
if (isc_kind == intersection_forced)
|
||||
{
|
||||
isc->y= m_y1;
|
||||
isc->x= a->x;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* intersection_normal */
|
||||
const point *a0= a->precursor;
|
||||
const point *b0= b->precursor;
|
||||
const point *a0= a->intersection_link;
|
||||
const point *b0= b->intersection_link;
|
||||
DBUG_ASSERT(!a0->horiz_dir || !b0->horiz_dir);
|
||||
|
||||
if (!a0->horiz_dir && !b0->horiz_dir)
|
||||
{
|
||||
double dk= a0->dx_dy - b0->dx_dy;
|
||||
@ -541,11 +708,11 @@ int Gcalc_scan_iterator::add_intersection(const point *a, const point *b,
|
||||
|
||||
if (fabs(dk) < INTERSECTION_ZERO)
|
||||
dy= 0.0;
|
||||
isc->y= m_y0 + dy;
|
||||
isc->y= current_state->y + dy;
|
||||
isc->x= a0->x + dy*a0->dx_dy;
|
||||
return 0;
|
||||
}
|
||||
isc->y= m_y1;
|
||||
isc->y= next_state->y;
|
||||
isc->x= a0->horiz_dir ? b->x : a->x;
|
||||
return 0;
|
||||
}
|
||||
@ -553,19 +720,18 @@ int Gcalc_scan_iterator::add_intersection(const point *a, const point *b,
|
||||
|
||||
int Gcalc_scan_iterator::find_intersections()
|
||||
{
|
||||
point *sp1= m_slice1;
|
||||
point *sp1= next_state->slice;
|
||||
Gcalc_dyn_list::Item **hook;
|
||||
|
||||
m_n_intersections= 0;
|
||||
{
|
||||
/* Set links between slicepoints */
|
||||
point *sp0= m_slice0;
|
||||
point *sp0= current_state->slice;
|
||||
for (; sp1; sp0= sp0->get_next(),sp1= sp1->get_next())
|
||||
{
|
||||
while (sp0->is_bottom())
|
||||
sp0= sp0->get_next();
|
||||
DBUG_ASSERT(!sp0->is_bottom());
|
||||
DBUG_ASSERT(sp0->thread == sp1->thread);
|
||||
sp1->precursor= sp0;
|
||||
sp1->intersection_link= sp0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -575,23 +741,18 @@ int Gcalc_scan_iterator::find_intersections()
|
||||
point *last_possible_isc= NULL;
|
||||
do
|
||||
{
|
||||
sp1= m_slice1;
|
||||
point **pprev_s1= &m_slice1;
|
||||
point **pprev_s1= &next_state->slice;
|
||||
intersections_found= false;
|
||||
unsigned int bottom_points_count= sp1->is_bottom() ? 1:0;
|
||||
sp1= m_slice1->get_next();
|
||||
int isc_kind;
|
||||
sp1= next_state->slice->get_next();
|
||||
point *cur_possible_isc= NULL;
|
||||
for (; sp1 != last_possible_isc;
|
||||
pprev_s1= (point **)(&(*pprev_s1)->next), sp1= sp1->get_next())
|
||||
{
|
||||
if (sp1->is_bottom())
|
||||
++bottom_points_count;
|
||||
if (!(isc_kind=intersection_found(*pprev_s1, sp1, bottom_points_count)))
|
||||
continue;
|
||||
point *prev_s1= *pprev_s1;
|
||||
if (prev_s1->x <= sp1->x)
|
||||
continue;
|
||||
intersections_found= true;
|
||||
if (add_intersection(prev_s1, sp1, isc_kind, &hook))
|
||||
if (add_intersection(prev_s1, sp1, &hook))
|
||||
return 1;
|
||||
*pprev_s1= sp1;
|
||||
prev_s1->next= sp1->next;
|
||||
@ -611,7 +772,9 @@ static int compare_intersections(const void *e0, const void *e1)
|
||||
{
|
||||
Gcalc_scan_iterator::intersection *i0= (Gcalc_scan_iterator::intersection *)e0;
|
||||
Gcalc_scan_iterator::intersection *i1= (Gcalc_scan_iterator::intersection *)e1;
|
||||
return i0->y > i1->y;
|
||||
if (i0->y != i1->y)
|
||||
return i0->y > i1->y;
|
||||
return i0->x > i1->x;
|
||||
}
|
||||
|
||||
|
||||
@ -624,144 +787,131 @@ inline void Gcalc_scan_iterator::sort_intersections()
|
||||
|
||||
int Gcalc_scan_iterator::handle_intersections()
|
||||
{
|
||||
DBUG_ASSERT(m_slice1->next);
|
||||
DBUG_ASSERT(next_state->slice->next);
|
||||
|
||||
if (find_intersections())
|
||||
return 1;
|
||||
sort_intersections();
|
||||
|
||||
m_sav_slice= m_slice1;
|
||||
m_sav_y= m_y1;
|
||||
m_slice1= new_slice(m_sav_slice);
|
||||
|
||||
m_cur_intersection= m_intersections;
|
||||
m_pre_intersection_hook= NULL;
|
||||
return intersection_scan();
|
||||
}
|
||||
|
||||
|
||||
void Gcalc_scan_iterator::pop_suitable_intersection()
|
||||
{
|
||||
intersection *prev_i= m_cur_intersection;
|
||||
intersection *cur_i= prev_i->get_next();
|
||||
for (; cur_i; prev_i= cur_i, cur_i= cur_i->get_next())
|
||||
/* Swap saved <-> next */
|
||||
{
|
||||
point *prev_p= m_slice0;
|
||||
point *sp= prev_p->get_next();
|
||||
for (; sp; prev_p= sp, sp= sp->get_next())
|
||||
{
|
||||
if ((prev_p->thread == cur_i->thread_a) &&
|
||||
(sp->thread == cur_i->thread_b))
|
||||
{
|
||||
/* Move cur_t on the top of the list */
|
||||
if (prev_i == m_cur_intersection)
|
||||
{
|
||||
m_cur_intersection->next= cur_i->next;
|
||||
cur_i->next= m_cur_intersection;
|
||||
m_cur_intersection= cur_i;
|
||||
}
|
||||
else
|
||||
{
|
||||
Gcalc_dyn_list::Item *tmp= m_cur_intersection->next;
|
||||
m_cur_intersection->next= cur_i->next;
|
||||
prev_i->next= m_cur_intersection;
|
||||
m_cur_intersection= cur_i;
|
||||
cur_i->next= tmp;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
slice_state *tmp= next_state;
|
||||
next_state= saved_state;
|
||||
saved_state= tmp;
|
||||
}
|
||||
DBUG_ASSERT(0);
|
||||
/* We need the next slice to be just equal */
|
||||
next_state->slice= new_slice(saved_state->slice);
|
||||
m_cur_intersection= m_intersections;
|
||||
return intersection_scan();
|
||||
}
|
||||
|
||||
|
||||
int Gcalc_scan_iterator::intersection_scan()
|
||||
{
|
||||
if (m_pre_intersection_hook) /*Skip the first point*/
|
||||
point *sp0, *sp1;
|
||||
Gcalc_dyn_list::Item **hook;
|
||||
intersection *next_intersection;
|
||||
|
||||
if (m_cur_intersection != m_intersections)
|
||||
{
|
||||
point *next= (*m_pre_intersection_hook)->get_next();
|
||||
(*m_pre_intersection_hook)->next= next->next;
|
||||
next->next= *m_pre_intersection_hook;
|
||||
*m_pre_intersection_hook= next;
|
||||
m_event0= scev_intersection;
|
||||
m_event_position0= next;
|
||||
point *tmp= m_slice1;
|
||||
m_slice1= m_slice0;
|
||||
m_slice0= tmp;
|
||||
m_y0= m_y1;
|
||||
m_cur_intersection= m_cur_intersection->get_next();
|
||||
/* Swap current <-> next */
|
||||
{
|
||||
slice_state *tmp= current_state;
|
||||
current_state= next_state;
|
||||
next_state= tmp;
|
||||
}
|
||||
|
||||
if (arrange_event())
|
||||
return 1;
|
||||
|
||||
if (!m_cur_intersection)
|
||||
{
|
||||
m_h= m_sav_y - m_y1;
|
||||
m_y1= m_sav_y;
|
||||
free_list(m_slice1);
|
||||
m_slice1= m_sav_slice;
|
||||
saved_state->event_position_hook=
|
||||
(Gcalc_dyn_list::Item **) &saved_state->slice;
|
||||
#ifdef TO_REMOVE
|
||||
for (sp0= current_state->slice, sp1= saved_state->slice;
|
||||
sp0;
|
||||
sp0= sp0->get_next(), sp1= sp1->get_next())
|
||||
{
|
||||
sp0->next_link= sp1;
|
||||
if (sp1->get_next() == saved_state->event_position)
|
||||
saved_state->event_position_hook= &sp1->next;
|
||||
}
|
||||
#endif /*TO_REMOVE*/
|
||||
for (sp1= saved_state->slice; sp1; sp1= sp1->get_next())
|
||||
{
|
||||
if (sp1->get_next() == saved_state->event_position)
|
||||
saved_state->event_position_hook= &sp1->next;
|
||||
}
|
||||
/* Swap saved <-> next */
|
||||
{
|
||||
slice_state *tmp= next_state;
|
||||
next_state= saved_state;
|
||||
saved_state= tmp;
|
||||
}
|
||||
free_list(saved_state->slice);
|
||||
saved_state->slice= NULL;
|
||||
|
||||
free_list(m_intersections);
|
||||
m_intersections= NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
m_y1= m_cur_intersection->y;
|
||||
m_h= m_y1 - m_y0;
|
||||
next_state->y= m_cur_intersection->y;
|
||||
|
||||
point *sp0;
|
||||
point **psp1;
|
||||
found_equal_intersection:
|
||||
sp0= current_state->slice;
|
||||
hook= (Gcalc_dyn_list::Item **) &next_state->slice;
|
||||
sp1= next_state->slice;
|
||||
next_state->clear_event_position();
|
||||
|
||||
redo_loop:
|
||||
sp0= m_slice0;
|
||||
psp1= &m_slice1;
|
||||
for (; sp0; sp0= sp0->get_next())
|
||||
for (; sp0;
|
||||
hook= &sp1->next, sp1= sp1->get_next(), sp0= sp0->get_next())
|
||||
{
|
||||
point *sp1= *psp1;
|
||||
if (sp0->thread == m_cur_intersection->thread_a)
|
||||
{
|
||||
point *next_s0= sp0;
|
||||
/* Skip Bottom points */
|
||||
do
|
||||
next_s0= next_s0->get_next();
|
||||
while(next_s0->is_bottom()); /* We always find nonbottom point here*/
|
||||
/* If the next point's thread isn't the thread of intersection,
|
||||
we try to find suitable intersection */
|
||||
if (next_s0->thread != m_cur_intersection->thread_b)
|
||||
{
|
||||
/* It's really rare case - sometimes happen when
|
||||
there's two intersections with the same Y
|
||||
Move suitable one to the beginning of the list
|
||||
*/
|
||||
pop_suitable_intersection();
|
||||
goto redo_loop;
|
||||
}
|
||||
m_pre_intersection_hook= psp1;
|
||||
sp1->copy_core(sp0);
|
||||
sp1->x= m_cur_intersection->x;
|
||||
sp0= next_s0;
|
||||
sp1= sp1->get_next();
|
||||
sp1->copy_core(sp0);
|
||||
sp1->x= m_cur_intersection->x;
|
||||
psp1= (point **)&sp1->next;
|
||||
continue;
|
||||
}
|
||||
if (!sp0->is_bottom())
|
||||
if (sp0->thread == m_cur_intersection->thread_a ||
|
||||
sp0->thread == m_cur_intersection->thread_b)
|
||||
{
|
||||
sp1->copy_core(sp0);
|
||||
sp1->x= sp1->horiz_dir ? sp0->x :
|
||||
(coord_to_float(sp1->pi->x) +
|
||||
(m_y1-coord_to_float(sp1->pi->y)) * sp1->dx_dy);
|
||||
sp1->x= m_cur_intersection->x;
|
||||
sp1->event= scev_intersection;
|
||||
mark_event_position1(sp1, hook);
|
||||
}
|
||||
else
|
||||
/* Skip bottom point */
|
||||
continue;
|
||||
psp1= (point **)&sp1->next;
|
||||
{
|
||||
sp1->copy_core(sp0);
|
||||
sp1->x= sp1->horiz_dir ?
|
||||
m_cur_intersection->x :
|
||||
coord_to_float(sp1->pi->x) +
|
||||
(next_state->y-coord_to_float(sp1->pi->y)) * sp1->dx_dy;
|
||||
if (coord_eq(sp1->x, m_cur_intersection->x))
|
||||
{
|
||||
sp1->event= scev_intersection;
|
||||
mark_event_position1(sp1, hook);
|
||||
}
|
||||
else
|
||||
sp1->event= scev_none;
|
||||
}
|
||||
}
|
||||
|
||||
if (*psp1)
|
||||
if (sp1)
|
||||
{
|
||||
free_list(*psp1);
|
||||
*psp1= NULL;
|
||||
free_list(sp1);
|
||||
*hook= NULL;
|
||||
}
|
||||
|
||||
next_intersection= m_cur_intersection->get_next();
|
||||
if (next_intersection &&
|
||||
coord_eq(next_intersection->x, m_cur_intersection->x) &&
|
||||
coord_eq(next_intersection->y, m_cur_intersection->y))
|
||||
{
|
||||
m_cur_intersection= next_intersection;
|
||||
goto found_equal_intersection;
|
||||
}
|
||||
m_cur_intersection= next_intersection;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_SPATIAL */
|
||||
|
||||
|
@ -236,6 +236,7 @@ public:
|
||||
|
||||
enum Gcalc_scan_events
|
||||
{
|
||||
scev_none= 0,
|
||||
scev_point= 1, /* Just a new point in thread */
|
||||
scev_thread= 2, /* Start of the new thread */
|
||||
scev_two_threads= 4, /* A couple of new threads started */
|
||||
@ -268,7 +269,13 @@ public:
|
||||
Gcalc_heap::Info *pi;
|
||||
Gcalc_heap::Info *next_pi;
|
||||
sc_thread_id thread;
|
||||
const point *precursor; /* used as a temporary field */
|
||||
|
||||
const point *intersection_link;
|
||||
Gcalc_scan_events event;
|
||||
#ifdef TO_REMOVE
|
||||
const point *event_pair;
|
||||
point *next_link;
|
||||
#endif /*TO_REMOVE*/
|
||||
|
||||
inline const point *c_get_next() const
|
||||
{ return (const point *)next; }
|
||||
@ -276,15 +283,17 @@ public:
|
||||
gcalc_shape_info get_shape() const { return pi->shape; }
|
||||
inline point *get_next() { return (point *)next; }
|
||||
inline const point *get_next() const { return (const point *)next; }
|
||||
|
||||
/* copies all but 'next' 'x' and 'precursor' */
|
||||
void copy_core(const point *from)
|
||||
void copy_core(point *from);
|
||||
/* Compare the dx_dy parameters regarding the horiz_dir */
|
||||
/* returns -1 if less, 0 if equal, 1 if bigger */
|
||||
static int compare_dx_dy(int horiz_dir_a, double dx_dy_a,
|
||||
int horiz_dir_b, double dx_dy_b);
|
||||
int cmp_dx_dy(const point *p) const;
|
||||
int simple_event() const
|
||||
{
|
||||
dx_dy= from->dx_dy;
|
||||
horiz_dir= from->horiz_dir;
|
||||
pi= from->pi;
|
||||
next_pi= from->next_pi;
|
||||
thread= from->thread;
|
||||
return !next ? (event & (scev_point | scev_end)) :
|
||||
(!next->next && event == scev_two_ends);
|
||||
}
|
||||
#ifndef DBUG_OFF
|
||||
void dbug_print();
|
||||
@ -301,6 +310,22 @@ public:
|
||||
inline intersection *get_next() { return (intersection *)next; }
|
||||
};
|
||||
|
||||
class slice_state
|
||||
{
|
||||
public:
|
||||
point *slice;
|
||||
point *event_position;
|
||||
Gcalc_dyn_list::Item **event_position_hook;
|
||||
Gcalc_dyn_list::Item **event_end_hook;
|
||||
double y;
|
||||
slice_state() : slice(NULL) {}
|
||||
void clear_event_position()
|
||||
{
|
||||
event_position= NULL;
|
||||
event_end_hook= (Gcalc_dyn_list::Item **) &event_position;
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
Gcalc_scan_iterator(size_t blk_size= 8192);
|
||||
|
||||
@ -309,50 +334,46 @@ public:
|
||||
int step()
|
||||
{
|
||||
DBUG_ASSERT(more_points());
|
||||
return m_cur_intersection ? intersection_scan() : normal_scan();
|
||||
return m_intersections ? intersection_scan() : normal_scan();
|
||||
}
|
||||
|
||||
inline Gcalc_heap::Info *more_points() { return m_cur_pi; }
|
||||
inline bool more_trapezoids()
|
||||
{ return m_cur_pi && m_cur_pi->next; }
|
||||
|
||||
inline Gcalc_scan_events get_event() const { return m_event0; }
|
||||
inline const point *get_events() const
|
||||
{ return m_events; }
|
||||
inline const point *get_event_position() const
|
||||
{ return m_event_position0; }
|
||||
inline const point *get_b_slice() const { return m_slice0; }
|
||||
inline const point *get_t_slice() const { return m_slice1; }
|
||||
inline double get_h() const { return m_h; }
|
||||
inline double get_y() const { return m_y0; }
|
||||
{ return current_state->event_position; }
|
||||
inline const point *get_event_end() const
|
||||
{ return (point *) *current_state->event_end_hook; }
|
||||
inline const point *get_b_slice() const { return current_state->slice; }
|
||||
inline const point *get_t_slice() const { return next_state->slice; }
|
||||
inline double get_h() const { return current_state->y - next_state->y; }
|
||||
inline double get_y() const { return current_state->y; }
|
||||
|
||||
private:
|
||||
Gcalc_heap::Info *m_cur_pi;
|
||||
point *m_slice0;
|
||||
point *m_slice1;
|
||||
point *m_sav_slice;
|
||||
slice_state state0, state1, state_s;
|
||||
slice_state *current_state;
|
||||
slice_state *next_state;
|
||||
slice_state *saved_state;
|
||||
|
||||
intersection *m_intersections;
|
||||
int m_n_intersections;
|
||||
intersection *m_cur_intersection;
|
||||
point **m_pre_intersection_hook;
|
||||
double m_h;
|
||||
double m_y0;
|
||||
double m_y1;
|
||||
double m_sav_y;
|
||||
bool m_next_is_top_point;
|
||||
unsigned int m_bottom_points_count;
|
||||
sc_thread_id m_cur_thread;
|
||||
Gcalc_scan_events m_event0, m_event1;
|
||||
point *m_event_position0;
|
||||
point *m_event_position1;
|
||||
|
||||
point *m_events;
|
||||
int normal_scan();
|
||||
int intersection_scan();
|
||||
void sort_intersections();
|
||||
int handle_intersections();
|
||||
int insert_top_point();
|
||||
int add_intersection(const point *a, const point *b,
|
||||
int isc_kind, Gcalc_dyn_list::Item ***p_hook);
|
||||
Gcalc_dyn_list::Item ***p_hook);
|
||||
int find_intersections();
|
||||
void pop_suitable_intersection();
|
||||
|
||||
intersection *new_intersection()
|
||||
{
|
||||
@ -363,6 +384,8 @@ private:
|
||||
return (point *)new_item();
|
||||
}
|
||||
point *new_slice(point *example);
|
||||
int arrange_event();
|
||||
void mark_event_position1(point *ep, Gcalc_dyn_list::Item **ep_hook);
|
||||
};
|
||||
|
||||
|
||||
@ -427,6 +450,8 @@ public:
|
||||
inline const Gcalc_heap::Info *get_pi() const { return sp->pi; }
|
||||
inline gcalc_shape_info get_shape() const { return sp->get_shape(); }
|
||||
inline double get_x() const { return sp->x; }
|
||||
inline void restart(const Gcalc_scan_iterator *scan_i)
|
||||
{ sp= scan_i->get_b_slice(); }
|
||||
};
|
||||
|
||||
#endif /*GCALC_SLICESCAN_INCLUDED*/
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -45,6 +45,7 @@ private:
|
||||
String function_buffer;
|
||||
const char *cur_func;
|
||||
int *i_states;
|
||||
int *saved_i_states;
|
||||
uint32 cur_object_id;
|
||||
uint n_shapes;
|
||||
int count_internal();
|
||||
@ -90,7 +91,10 @@ public:
|
||||
void set_states(int *shape_states) { i_states= shape_states; }
|
||||
int alloc_states();
|
||||
void invert_state(gcalc_shape_info shape) { i_states[shape]^= 1; }
|
||||
void set_on_state(gcalc_shape_info shape) { i_states[shape]= 1; }
|
||||
int get_state(gcalc_shape_info shape) { return i_states[shape]; }
|
||||
void save_states();
|
||||
void restore_states();
|
||||
int count()
|
||||
{
|
||||
cur_func= function_buffer.ptr();
|
||||
@ -210,6 +214,7 @@ public:
|
||||
res_point *up;
|
||||
res_point *down;
|
||||
res_point *glue;
|
||||
Gcalc_function::shape_type type;
|
||||
union
|
||||
{
|
||||
const Gcalc_heap::Info *pi;
|
||||
@ -228,8 +233,10 @@ public:
|
||||
{
|
||||
public:
|
||||
res_point *rp;
|
||||
int result_range;
|
||||
int horiz_dir;
|
||||
double dx_dy;
|
||||
res_point *thread_start;
|
||||
res_point *enabled() { return rp; }
|
||||
active_thread *get_next() { return (active_thread *)next; }
|
||||
};
|
||||
|
||||
@ -240,6 +247,60 @@ public:
|
||||
poly_instance *get_next() { return (poly_instance *)next; }
|
||||
};
|
||||
|
||||
class line : public Gcalc_dyn_list::Item
|
||||
{
|
||||
public:
|
||||
active_thread *t;
|
||||
int incoming;
|
||||
const Gcalc_scan_iterator::point *p;
|
||||
line *get_next() { return (line *)next; }
|
||||
};
|
||||
|
||||
class poly_border : public Gcalc_dyn_list::Item
|
||||
{
|
||||
public:
|
||||
active_thread *t;
|
||||
int incoming;
|
||||
int prev_state;
|
||||
const Gcalc_scan_iterator::point *p;
|
||||
poly_border *get_next() { return (poly_border *)next; }
|
||||
};
|
||||
|
||||
line *m_lines;
|
||||
Gcalc_dyn_list::Item **m_lines_hook;
|
||||
poly_border *m_poly_borders;
|
||||
Gcalc_dyn_list::Item **m_poly_borders_hook;
|
||||
line *new_line() { return (line *) new_item(); }
|
||||
poly_border *new_poly_border() { return (poly_border *) new_item(); }
|
||||
int add_line(int incoming, active_thread *t,
|
||||
const Gcalc_scan_iterator::point *p)
|
||||
{
|
||||
line *l= new_line();
|
||||
if (!l)
|
||||
return 1;
|
||||
l->incoming= incoming;
|
||||
l->t= t;
|
||||
l->p= p;
|
||||
*m_lines_hook= l;
|
||||
m_lines_hook= &l->next;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int add_poly_border(int incoming, active_thread *t, int prev_state,
|
||||
const Gcalc_scan_iterator::point *p)
|
||||
{
|
||||
poly_border *b= new_poly_border();
|
||||
if (!b)
|
||||
return 1;
|
||||
b->incoming= incoming;
|
||||
b->t= t;
|
||||
b->prev_state= prev_state;
|
||||
b->p= p;
|
||||
*m_poly_borders_hook= b;
|
||||
m_poly_borders_hook= &b->next;
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
Gcalc_function *m_fn;
|
||||
Gcalc_dyn_list::Item **m_res_hook;
|
||||
@ -249,12 +310,13 @@ protected:
|
||||
res_point *result_heap;
|
||||
active_thread *m_first_active_thread;
|
||||
|
||||
res_point *add_res_point()
|
||||
res_point *add_res_point(Gcalc_function::shape_type type)
|
||||
{
|
||||
res_point *result= (res_point *)new_item();
|
||||
*m_res_hook= result;
|
||||
result->prev_hook= m_res_hook;
|
||||
m_res_hook= &result->next;
|
||||
result->type= type;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -263,44 +325,27 @@ protected:
|
||||
poly_instance *new_poly() { return (poly_instance *) new_item(); }
|
||||
|
||||
private:
|
||||
int continue_range(active_thread *t, const Gcalc_heap::Info *p);
|
||||
int continue_i_range(active_thread *t, const Gcalc_heap::Info *p,
|
||||
double x, double y);
|
||||
int start_range(active_thread *t, const Gcalc_heap::Info *p);
|
||||
int start_i_range(active_thread *t, const Gcalc_heap::Info *p,
|
||||
double x, double y);
|
||||
int end_range(active_thread *t, const Gcalc_heap::Info *p);
|
||||
int end_i_range(active_thread *t, const Gcalc_heap::Info *p,
|
||||
double x, double y);
|
||||
int start_couple(active_thread *t0, active_thread *t1,const Gcalc_heap::Info *p,
|
||||
const active_thread *prev_range);
|
||||
int start_i_couple(active_thread *t0, active_thread *t1,
|
||||
const Gcalc_heap::Info *p0,
|
||||
const Gcalc_heap::Info *p1,
|
||||
double x, double y,
|
||||
const active_thread *prev_range);
|
||||
int start_line(active_thread *t, const Gcalc_scan_iterator::point *p,
|
||||
const Gcalc_heap::Info *ev_p, const Gcalc_scan_iterator *si);
|
||||
int end_line(active_thread *t, const Gcalc_heap::Info *ev_p,
|
||||
const Gcalc_scan_iterator *si);
|
||||
int connect_threads(int incoming_a, int incoming_b,
|
||||
active_thread *ta, active_thread *tb,
|
||||
const Gcalc_scan_iterator::point *pa,
|
||||
const Gcalc_scan_iterator::point *pb,
|
||||
active_thread *prev_range,
|
||||
const Gcalc_heap::Info *ev_p,
|
||||
const Gcalc_scan_iterator *si,
|
||||
Gcalc_function::shape_type s_t);
|
||||
int add_single_point(const Gcalc_heap::Info *p,
|
||||
const Gcalc_scan_iterator *si);
|
||||
poly_border *get_pair_border(poly_border *b1);
|
||||
int continue_range(active_thread *t, const Gcalc_heap::Info *p,
|
||||
int horiz_dir, double dx_dy);
|
||||
int continue_i_range(active_thread *t, double x, double y,
|
||||
int horiz_dir, double dx_dy);
|
||||
int end_couple(active_thread *t0, active_thread *t1, const Gcalc_heap::Info *p);
|
||||
int end_i_couple(active_thread *t0, active_thread *t1,
|
||||
const Gcalc_heap::Info *p0,
|
||||
const Gcalc_heap::Info *p1,
|
||||
double x, double y);
|
||||
int add_single_point(const Gcalc_heap::Info *p);
|
||||
int add_i_single_point(const Gcalc_heap::Info *p, double x, double y);
|
||||
|
||||
int handle_lines_intersection(active_thread *t0, active_thread *t1,
|
||||
const Gcalc_heap::Info *p0,
|
||||
const Gcalc_heap::Info *p1,
|
||||
double x, double y);
|
||||
int handle_polygons_intersection(active_thread *t0, active_thread *t1,
|
||||
Gcalc_dyn_list::Item **t_hook,
|
||||
const Gcalc_heap::Info *p0,
|
||||
const Gcalc_heap::Info *p1,
|
||||
int prev_state, double x, double y,
|
||||
const active_thread *prev_range);
|
||||
int handle_line_polygon_intersection(active_thread *l,
|
||||
const Gcalc_heap::Info *pl,
|
||||
int line_state, int poly_state,
|
||||
double x, double y);
|
||||
|
||||
int get_single_result(res_point *res, Gcalc_result_receiver *storage);
|
||||
int get_result_thread(res_point *cur, Gcalc_result_receiver *storage,
|
||||
|
@ -665,10 +665,12 @@ static int calc_distance(double *result, Gcalc_heap *collector, uint obj2_si,
|
||||
{
|
||||
bool above_cur_point, cur_point_edge;
|
||||
const Gcalc_scan_iterator::point *evpos;
|
||||
const Gcalc_heap::Info *cur_point, *dist_point;
|
||||
Gcalc_scan_events ev;
|
||||
const Gcalc_heap::Info *cur_point= NULL;
|
||||
const Gcalc_heap::Info *dist_point;
|
||||
const Gcalc_scan_iterator::point *ev;
|
||||
double t, distance, cur_distance;
|
||||
double ex, ey, vx, vy, e_sqrlen;
|
||||
int o1, o2;
|
||||
|
||||
DBUG_ENTER("calc_distance");
|
||||
|
||||
@ -680,32 +682,39 @@ static int calc_distance(double *result, Gcalc_heap *collector, uint obj2_si,
|
||||
if (scan_it->step())
|
||||
goto mem_error;
|
||||
evpos= scan_it->get_event_position();
|
||||
ev= scan_it->get_event();
|
||||
cur_point= evpos->pi;
|
||||
ev= scan_it->get_events();
|
||||
cur_point= NULL;
|
||||
|
||||
if (ev->simple_event())
|
||||
{
|
||||
cur_point= ev->pi;
|
||||
goto calculate_distance;
|
||||
}
|
||||
|
||||
/*
|
||||
handling intersection we only need to check if it's the intersecion
|
||||
of objects 1 and 2. In this case distance is 0
|
||||
*/
|
||||
if (ev == scev_intersection)
|
||||
o1= 0;
|
||||
o2= 0;
|
||||
for (; ev; ev= ev->get_next())
|
||||
{
|
||||
if ((evpos->get_next()->pi->shape >= obj2_si) !=
|
||||
(cur_point->shape >= obj2_si))
|
||||
if (ev->event != scev_intersection)
|
||||
cur_point= ev->pi;
|
||||
if (ev->pi->shape >= obj2_si)
|
||||
o2= 1;
|
||||
else
|
||||
o1= 1;
|
||||
if (o1 && o2)
|
||||
{
|
||||
distance= 0;
|
||||
goto exit;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (!cur_point)
|
||||
continue;
|
||||
|
||||
/*
|
||||
if we get 'scev_point | scev_end | scev_two_ends' we don't need
|
||||
to check for intersection of objects.
|
||||
Though we need to calculate distances.
|
||||
*/
|
||||
if (ev & (scev_point | scev_end | scev_two_ends))
|
||||
goto calculate_distance;
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
goto calculate_distance;
|
||||
/*
|
||||
having these events we need to check for possible intersection
|
||||
@ -728,7 +737,7 @@ static int calc_distance(double *result, Gcalc_heap *collector, uint obj2_si,
|
||||
distance= 0;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#endif /*TO_REMOVE*/
|
||||
|
||||
calculate_distance:
|
||||
if (cur_point->shape >= obj2_si)
|
||||
@ -1516,6 +1525,7 @@ longlong Item_func_issimple::val_int()
|
||||
Gcalc_operation_transporter trn(&func, &collector);
|
||||
Geometry *g;
|
||||
int result= 1;
|
||||
const Gcalc_scan_iterator::point *ev;
|
||||
|
||||
DBUG_ENTER("Item_func_issimple::val_int");
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
@ -1539,11 +1549,19 @@ longlong Item_func_issimple::val_int()
|
||||
if (scan_it.step())
|
||||
goto mem_error;
|
||||
|
||||
if (scan_it.get_event() == scev_intersection)
|
||||
{
|
||||
result= 0;
|
||||
break;
|
||||
}
|
||||
ev= scan_it.get_events();
|
||||
if (ev->simple_event())
|
||||
continue;
|
||||
|
||||
if ((ev->event == scev_thread || ev->event == scev_single_point) &&
|
||||
!ev->get_next())
|
||||
continue;
|
||||
|
||||
if (ev->event == scev_two_threads && !ev->get_next()->get_next())
|
||||
continue;
|
||||
|
||||
result= 0;
|
||||
break;
|
||||
}
|
||||
|
||||
collector.reset();
|
||||
@ -1553,7 +1571,6 @@ longlong Item_func_issimple::val_int()
|
||||
mem_error:
|
||||
null_value= 1;
|
||||
DBUG_RETURN(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1731,7 +1748,7 @@ double Item_func_distance::val_real()
|
||||
bool above_cur_point, cur_point_edge;
|
||||
const Gcalc_scan_iterator::point *evpos;
|
||||
const Gcalc_heap::Info *cur_point, *dist_point;
|
||||
Gcalc_scan_events ev;
|
||||
const Gcalc_scan_iterator::point *ev;
|
||||
double t, distance, cur_distance;
|
||||
double x1, x2, y1, y2;
|
||||
double ex, ey, vx, vy, e_sqrlen;
|
||||
@ -1782,39 +1799,24 @@ double Item_func_distance::val_real()
|
||||
if (scan_it.step())
|
||||
goto mem_error;
|
||||
evpos= scan_it.get_event_position();
|
||||
ev= scan_it.get_event();
|
||||
cur_point= evpos->pi;
|
||||
ev= scan_it.get_events();
|
||||
|
||||
if (ev->simple_event())
|
||||
{
|
||||
cur_point= ev->pi;
|
||||
goto count_distance;
|
||||
}
|
||||
/*
|
||||
handling intersection we only need to check if it's the intersecion
|
||||
of objects 1 and 2. In this case distance is 0
|
||||
*/
|
||||
if (ev == scev_intersection)
|
||||
{
|
||||
if ((evpos->get_next()->pi->shape >= obj2_si) !=
|
||||
(cur_point->shape >= obj2_si))
|
||||
{
|
||||
distance= 0;
|
||||
goto exit;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
if we get 'scev_point | scev_end | scev_two_ends' we don't need
|
||||
to check for intersection of objects.
|
||||
Though we need to calculate distances.
|
||||
*/
|
||||
if (ev & (scev_point | scev_end | scev_two_ends))
|
||||
goto count_distance;
|
||||
cur_point= NULL;
|
||||
|
||||
/*
|
||||
having these events we need to check for possible intersection
|
||||
of objects
|
||||
scev_thread | scev_two_threads | scev_single_point
|
||||
*/
|
||||
DBUG_ASSERT(ev & (scev_thread | scev_two_threads | scev_single_point));
|
||||
|
||||
func.clear_state();
|
||||
for (Gcalc_point_iterator pit(&scan_it); pit.point() != evpos; ++pit)
|
||||
{
|
||||
@ -1822,14 +1824,22 @@ double Item_func_distance::val_real()
|
||||
if ((func.get_shape_kind(si) == Gcalc_function::shape_polygon))
|
||||
func.invert_state(si);
|
||||
}
|
||||
func.invert_state(evpos->get_shape());
|
||||
if (func.count())
|
||||
|
||||
for (; ev; ev= ev->get_next())
|
||||
{
|
||||
/* Point of one object is inside the other - intersection found */
|
||||
distance= 0;
|
||||
goto exit;
|
||||
if (ev->event != scev_intersection)
|
||||
cur_point= ev->pi;
|
||||
func.set_on_state(evpos->get_shape());
|
||||
if (func.count())
|
||||
{
|
||||
/* Point of one object is inside the other - intersection found */
|
||||
distance= 0;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cur_point)
|
||||
continue;
|
||||
|
||||
count_distance:
|
||||
if (cur_point->shape >= obj2_si)
|
||||
|
@ -705,6 +705,8 @@ int Gis_line_string::store_shapes(Gcalc_shape_transporter *trn) const
|
||||
{
|
||||
uint32 n_points;
|
||||
double x, y;
|
||||
double prev_x, prev_y;
|
||||
int first_point= 1;
|
||||
const char *data= m_data;
|
||||
|
||||
if (no_data(m_data, 4))
|
||||
@ -720,8 +722,13 @@ int Gis_line_string::store_shapes(Gcalc_shape_transporter *trn) const
|
||||
{
|
||||
get_point(&x, &y, data);
|
||||
data+= POINT_DATA_SIZE;
|
||||
if (!first_point && x == prev_x && y == prev_y)
|
||||
continue;
|
||||
if (trn->add_point(x, y))
|
||||
return 1;
|
||||
first_point= 0;
|
||||
prev_x= x;
|
||||
prev_y= y;
|
||||
}
|
||||
|
||||
return trn->complete_line();
|
||||
@ -1119,6 +1126,9 @@ int Gis_polygon::store_shapes(Gcalc_shape_transporter *trn) const
|
||||
{
|
||||
uint32 n_linear_rings;
|
||||
const char *data= m_data;
|
||||
double first_x, first_y;
|
||||
double prev_x, prev_y;
|
||||
int was_equal_first= 0;
|
||||
|
||||
if (trn->start_poly())
|
||||
return 1;
|
||||
@ -1140,11 +1150,33 @@ int Gis_polygon::store_shapes(Gcalc_shape_transporter *trn) const
|
||||
return 1;
|
||||
|
||||
trn->start_ring();
|
||||
get_point(&first_x, &first_y, data);
|
||||
data+= POINT_DATA_SIZE;
|
||||
n_points--;
|
||||
prev_x= first_x;
|
||||
prev_y= first_y;
|
||||
if (trn->add_point(first_x, first_y))
|
||||
return 1;
|
||||
while (--n_points)
|
||||
{
|
||||
double x, y;
|
||||
get_point(&x, &y, data);
|
||||
data+= POINT_DATA_SIZE;
|
||||
if (x == prev_x && y == prev_y)
|
||||
continue;
|
||||
prev_x= x;
|
||||
prev_y= y;
|
||||
if (was_equal_first)
|
||||
{
|
||||
if (trn->add_point(first_x, first_y))
|
||||
return 1;
|
||||
was_equal_first= 0;
|
||||
}
|
||||
if (x == first_x && y == first_y)
|
||||
{
|
||||
was_equal_first= 1;
|
||||
continue;
|
||||
}
|
||||
if (trn->add_point(x, y))
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user