This function returns a new pcpatch object that indicates the intersection of a pcpatch object and the given geometry object.

Syntax

pcpatch ST_intersection(pcpatch pc, geometry geom);

Parameters

Parameter Description
pc The pcpatch object.
geom The geometry object of Ganos Geometry.

Examples

SELECT ST_AsText(ST_Explode(ST_Intersection(
      pa,
      'SRID=4326;POLYGON((-126.451 45.552, -126.42 47.55, -126.40 45.552, -126.451 45.552))'::geometry
)))
FROM patches WHERE id = 7;

             st_astext
--------------------------------------
 {"pcid":1,"pt":[-126.44,45.56,56,5]}
 {"pcid":1,"pt":[-126.43,45.57,57,5]}
 {"pcid":1,"pt":[-126.42,45.58,58,5]}
 {"pcid":1,"pt":[-126.41,45.59,59,5]}