Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a polygon geometry and multilinestring geometry. How do i find the intersection of both these geometries. Both the geometries are in same reference system. Does st_intersection gives me the intersection point???

share|improve this question
up vote 3 down vote accepted

Yes and no. From ST_Intersection:

Returns a geometry that represents the point set intersection of the Geometries.

The result will probably a (Multi)Linestring, where they intersect. To get the points from an intersection of lines and polygons, you need to extract either the exterior ring or interior rings (if they exist) from the polygon. For example, if you just need the exterior ring:

SELECT ST_AsText(ST_Intersection(ST_ExteriorRing(A), B))
  SELECT 'POLYGON ((180 330, 150 270, 225 232, 180 330))'::geometry AS A,
         'LINESTRING (131 315, 270 290, 170 220)'::geometry AS B
) AS data;

Results with

MULTIPOINT(169.075907590759 308.151815181518,191.918860526526 304.043370408898,203.038674033149 243.127071823204,215.791505791506 252.054054054054)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.