ST_Intersection
Créer une géométrie qui est l'intersection d'un tableau de géométries.
Tous les systèmes de coordonnées sont considérés comme Cartesian.w
Syntaxe
ST_Intersection(geo);
ST_Intersection(geo1,geo2);
- géographie
- Une colonne de table de type VARCHAR(ANY) contenant des géométries.
- geo1
- La première géométrie d'entrée.
Type : VARCHAR(ANY)
- geo2
- La deuxième géométrie d'entrée.
Type : VARCHAR(ANY)
Retours
Une valeur de type VARCHAR(ANY) qui contient la géométrie partagée. Si aucun point n'est partagé, la géométrie est vide.
Exemples
CREATE TABLE points (PointID integer, the_geom VARCHAR(200));
INSERT INTO points VALUES (1, inza..ST_WKTToSQL('Point (0 0)'));
INSERT INTO points VALUES (2, inza..ST_WKTToSQL('Point (22 0)'));
INSERT INTO points VALUES (3, inza..ST_WKTToSQL('Point (33 33)'));
INSERT INTO points VALUES (4, inza..ST_WKTToSQL('Point (44 44)'));
SELECT inza..ST_AsText(inza..ST_Intersection(the_geom)) from (SELECT the_geom from
points order by PointID LIMIT 9999999) points;
ST_ASTEXT
---------
GEOMETRYCOLLECTION EMPTY
(1 row)
SELECT inza..ST_AsText(inza..ST_Intersection(inza..ST_WKTToSQL('
POLYGON ((0 0, 11 0, 11 11, 0 11, 0 0))'), inza..ST_WKTToSQL('
POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))')));
ST_ASTEXT
---------
POLYGON ((10 11, 11 11, 11 10.5, 10 10, 10 11))
(1 row)
SELECT inza..ST_AsText(inza..ST_Intersection(inza..ST_WKTToSQL('
POLYGON ((0 0, 0 5, 5 5, 5 0, 0 0))'), inza..ST_WKTToSQL('
POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))')));
ST_ASTEXT
-----------
GEOMETRYCOLLECTION EMPTY
(1 row)
SELECT inza..ST_AsText(inza..ST_Intersection(inza..ST_WKTToSQL('
POLYGON ((0 0, 0 15, 15 15, 15 0, 0 0))'), inza..ST_WKTToSQL('
POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))')));
ST_ASTEXT
-----------
POLYGON ((10 15, 15 15, 15 12.5, 10 10, 10 15))
(1 row)