ST_Aggr_Intersection

RemarqueRemarque :

ST_Geometry dans Oracle uniquement

Définition

ST_Aggr_Intersection renvoie un objet ST_Geometry unique correspondant à l'union de l'intersection de toutes les géométries en entrée.

Syntaxe

st_aggr_intersection (g1 sde.st_geometry)

Type de retour

ST_Geometry

Exemple

Dans cet exemple, un biologiste essaie de trouver l'intersection de trois habitats naturels.

En premier lieu, créez la table qui stocke les habitats.

CREATE TABLE habitats (id integer, shape sde.st_geometry);

Ensuite, insérez les trois polygones à la table.

INSERT INTO habitats VALUES (
1,
sde.st_polygon ('polygon ((5 5, 12 5, 12 10, 5 10, 5 5))', 0)
);

INSERT INTO habitats VALUES (
2,
sde.st_polygon ('polygon ((10 8, 14 8, 14 15, 10 15, 10 8))', 0)
);

INSERT INTO habitats VALUES (
3,
sde.st_polygon ('polygon ((6 8, 20 8, 20 20, 6 20, 6 8))', 0)
);

Enfin, sélectionnez l'intersection des habitats.

SELECT sde.st_astext(sde.st_aggr_intersection(shape)) AGGR_SHAPES FROM habitats;

AGGR_SHAPES

POLYGON  (( 10.00000000 8.00000000, 12.00000000 8.00000000, 12.00000000 10.00000000, 
10.00000000 10.00000000, 10.00000000 8.00000000))

7/10/2012