[GIS] How to find the intersection of two polylines in PostGIS

google mapslinepostgisrouting

I have a set of road conditions reported for small segments of road, and I am hoping to determine the specific subset of each segment which intersect with a route along the road so that I can draw the intersection of the route and road conditions on a map.

Is there a way to determine the specific points of intersection of two polylines in PostGIS in a way suitable for plotting on a Google Map?

I am new to PostGIS so please accept my apologize if I am getting any terminology wrong.

Best Answer

St_Intersection function will give you the a point/collection of points that are the intersection of two linestrings. ST_Intersects can be used to find linestrings that intersect.