2004-05-27 17:31:30 +02:00
|
|
|
-- source include/have_geometry.inc
|
|
|
|
|
2003-03-01 10:16:39 +01:00
|
|
|
#
|
|
|
|
# Spatial objects
|
|
|
|
#
|
|
|
|
|
|
|
|
--disable_warnings
|
2004-03-04 07:50:37 +01:00
|
|
|
DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
|
2003-03-01 10:16:39 +01:00
|
|
|
--enable_warnings
|
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
|
|
|
|
CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
|
|
|
|
CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
|
|
|
|
CREATE TABLE gis_multi_point (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT);
|
|
|
|
CREATE TABLE gis_multi_line (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING);
|
|
|
|
CREATE TABLE gis_multi_polygon (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON);
|
|
|
|
CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION);
|
|
|
|
CREATE TABLE gis_geometry (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
|
|
|
|
|
|
|
|
SHOW FIELDS FROM gis_point;
|
|
|
|
SHOW FIELDS FROM gis_line;
|
|
|
|
SHOW FIELDS FROM gis_polygon;
|
|
|
|
SHOW FIELDS FROM gis_multi_point;
|
|
|
|
SHOW FIELDS FROM gis_multi_line;
|
|
|
|
SHOW FIELDS FROM gis_multi_polygon;
|
|
|
|
SHOW FIELDS FROM gis_geometrycollection;
|
|
|
|
SHOW FIELDS FROM gis_geometry;
|
|
|
|
|
|
|
|
|
|
|
|
INSERT INTO gis_point VALUES
|
2003-03-01 10:16:39 +01:00
|
|
|
(101, PointFromText('POINT(10 10)')),
|
|
|
|
(102, PointFromText('POINT(20 10)')),
|
|
|
|
(103, PointFromText('POINT(20 20)')),
|
2003-04-03 12:13:14 +02:00
|
|
|
(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
|
2003-03-01 10:16:39 +01:00
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
INSERT INTO gis_line VALUES
|
2003-03-01 10:16:39 +01:00
|
|
|
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
|
|
|
|
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
|
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
mysql-test/t/gis.test:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
sql/lex.h:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
2003-04-02 12:38:06 +02:00
|
|
|
(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
|
2003-03-01 10:16:39 +01:00
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
INSERT INTO gis_polygon VALUES
|
2003-03-01 10:16:39 +01:00
|
|
|
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
|
|
|
|
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
|
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
mysql-test/t/gis.test:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
sql/lex.h:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
2003-04-02 12:38:06 +02:00
|
|
|
(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
|
2003-03-01 10:16:39 +01:00
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
INSERT INTO gis_multi_point VALUES
|
2003-03-01 10:16:39 +01:00
|
|
|
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
|
|
|
|
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
|
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
mysql-test/t/gis.test:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
sql/lex.h:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
2003-04-02 12:38:06 +02:00
|
|
|
(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
|
2003-03-01 10:16:39 +01:00
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
INSERT INTO gis_multi_line VALUES
|
2003-03-01 10:16:39 +01:00
|
|
|
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
|
|
|
|
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
|
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
mysql-test/t/gis.test:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
sql/lex.h:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
2003-04-02 12:38:06 +02:00
|
|
|
(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
|
2003-03-01 10:16:39 +01:00
|
|
|
|
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
INSERT INTO gis_multi_polygon VALUES
|
2003-03-01 10:16:39 +01:00
|
|
|
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
|
|
|
|
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
|
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
mysql-test/t/gis.test:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
sql/lex.h:
GEOMCOLLFROMWKB(), GEOMETRYCOLLECTIONFROMWKB(),
LINEFROMWKB(), LINESTRINGFROMWKB(), MLINEFROMWKB(), MPOINTFROMWKB(),
MPOLYFROMWKB(), MULTILINESTRINGFROMWKB(), MULTIPOINTFROMWKB(),
MULTIPOLYGONFROMWKB(), POINTFROMWKB(), POLYFROMWKB(), POLYGONFROMWKB()
functions have been added (as synonyms for GEOMFROMWKB()).
2003-04-02 12:38:06 +02:00
|
|
|
(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
|
2003-03-01 10:16:39 +01:00
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
INSERT INTO gis_geometrycollection VALUES
|
2003-03-01 10:16:39 +01:00
|
|
|
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
|
2003-03-18 12:30:32 +01:00
|
|
|
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
|
2003-03-01 10:16:39 +01:00
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
INSERT into gis_geometry SELECT * FROM gis_point;
|
|
|
|
INSERT into gis_geometry SELECT * FROM gis_line;
|
|
|
|
INSERT into gis_geometry SELECT * FROM gis_polygon;
|
|
|
|
INSERT into gis_geometry SELECT * FROM gis_multi_point;
|
|
|
|
INSERT into gis_geometry SELECT * FROM gis_multi_line;
|
|
|
|
INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
|
|
|
|
INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
|
|
|
|
|
|
|
|
SELECT fid, AsText(g) FROM gis_point;
|
|
|
|
SELECT fid, AsText(g) FROM gis_line;
|
|
|
|
SELECT fid, AsText(g) FROM gis_polygon;
|
|
|
|
SELECT fid, AsText(g) FROM gis_multi_point;
|
|
|
|
SELECT fid, AsText(g) FROM gis_multi_line;
|
|
|
|
SELECT fid, AsText(g) FROM gis_multi_polygon;
|
|
|
|
SELECT fid, AsText(g) FROM gis_geometrycollection;
|
|
|
|
SELECT fid, AsText(g) FROM gis_geometry;
|
|
|
|
|
|
|
|
SELECT fid, Dimension(g) FROM gis_geometry;
|
|
|
|
SELECT fid, GeometryType(g) FROM gis_geometry;
|
|
|
|
SELECT fid, IsEmpty(g) FROM gis_geometry;
|
|
|
|
SELECT fid, AsText(Envelope(g)) FROM gis_geometry;
|
|
|
|
explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
|
|
|
|
|
|
|
|
SELECT fid, X(g) FROM gis_point;
|
|
|
|
SELECT fid, Y(g) FROM gis_point;
|
|
|
|
explain extended select X(g),Y(g) FROM gis_point;
|
|
|
|
|
|
|
|
SELECT fid, AsText(StartPoint(g)) FROM gis_line;
|
|
|
|
SELECT fid, AsText(EndPoint(g)) FROM gis_line;
|
|
|
|
SELECT fid, GLength(g) FROM gis_line;
|
|
|
|
SELECT fid, NumPoints(g) FROM gis_line;
|
|
|
|
SELECT fid, AsText(PointN(g, 2)) FROM gis_line;
|
|
|
|
SELECT fid, IsClosed(g) FROM gis_line;
|
|
|
|
explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
|
|
|
|
|
|
|
|
SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
|
|
|
|
SELECT fid, Area(g) FROM gis_polygon;
|
|
|
|
SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon;
|
|
|
|
SELECT fid, NumInteriorRings(g) FROM gis_polygon;
|
|
|
|
SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon;
|
|
|
|
explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
|
|
|
|
|
|
|
|
SELECT fid, IsClosed(g) FROM gis_multi_line;
|
|
|
|
|
|
|
|
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
|
|
|
|
SELECT fid, Area(g) FROM gis_multi_polygon;
|
|
|
|
|
|
|
|
SELECT fid, NumGeometries(g) from gis_multi_point;
|
|
|
|
SELECT fid, NumGeometries(g) from gis_multi_line;
|
|
|
|
SELECT fid, NumGeometries(g) from gis_multi_polygon;
|
|
|
|
SELECT fid, NumGeometries(g) from gis_geometrycollection;
|
|
|
|
explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
|
|
|
|
|
|
|
|
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
|
|
|
|
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line;
|
|
|
|
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon;
|
|
|
|
SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection;
|
|
|
|
SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection;
|
|
|
|
explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
|
2003-03-01 10:16:39 +01:00
|
|
|
|
|
|
|
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,
|
|
|
|
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
2004-03-04 07:50:37 +01:00
|
|
|
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
2003-11-06 20:03:11 +01:00
|
|
|
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,
|
|
|
|
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
|
2004-03-04 07:50:37 +01:00
|
|
|
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
2003-03-01 10:16:39 +01:00
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
|
2003-03-31 06:19:20 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Check that ALTER TABLE doesn't loose geometry type
|
|
|
|
#
|
2004-03-04 07:50:37 +01:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
gp point,
|
2003-03-31 06:19:20 +02:00
|
|
|
ln linestring,
|
|
|
|
pg polygon,
|
2004-03-04 07:50:37 +01:00
|
|
|
mp multipoint,
|
2003-03-31 06:19:20 +02:00
|
|
|
mln multilinestring,
|
|
|
|
mpg multipolygon,
|
|
|
|
gc geometrycollection,
|
|
|
|
gm geometry
|
|
|
|
);
|
|
|
|
|
2004-03-04 07:50:37 +01:00
|
|
|
SHOW FIELDS FROM t1;
|
|
|
|
ALTER TABLE t1 ADD fid INT NOT NULL;
|
|
|
|
SHOW FIELDS FROM t1;
|
|
|
|
DROP TABLE t1;
|
2003-04-03 12:13:14 +02:00
|
|
|
|
|
|
|
SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))));
|
2003-11-06 20:03:11 +01:00
|
|
|
explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))));
|
|
|
|
explain extended SELECT AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))));
|
|
|
|
SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
|
|
|
|
explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
|
|
|
|
#select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)),issimple(PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),issimple(GeometryFromText('POINT(1 4)')), issimple(AsWKB(GeometryFromText('POINT(1 4)')));
|
|
|
|
explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6));
|
2004-03-16 11:59:22 +01:00
|
|
|
|
|
|
|
create table t1 (a geometry not null);
|
|
|
|
insert into t1 values (GeomFromText('Point(1 2)'));
|
|
|
|
-- error 1105
|
|
|
|
insert into t1 values ('Garbage');
|
2004-03-17 11:03:26 +01:00
|
|
|
-- error 1105
|
|
|
|
insert IGNORE into t1 values ('Garbage');
|
2004-03-16 11:59:22 +01:00
|
|
|
alter table t1 add spatial index(a);
|
|
|
|
|
|
|
|
drop table t1;
|
2004-08-26 13:51:26 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Bug #5219: problem with range optimizer
|
|
|
|
#
|
|
|
|
|
|
|
|
create table t1(a geometry not null, spatial index(a));
|
|
|
|
insert into t1 values
|
|
|
|
(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')),
|
|
|
|
(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)'));
|
|
|
|
select AsText(a) from t1 where
|
|
|
|
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
|
|
|
|
or
|
|
|
|
MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a);
|
|
|
|
select AsText(a) from t1 where
|
|
|
|
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
|
|
|
|
and
|
|
|
|
MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a);
|
|
|
|
drop table t1;
|