3

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.

3

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.

  • Thanks! I'll give that function a try once I've got my data loaded in. Is there a tolerance when a point is considered "close enough" to overlap or do the points need to be identical to match? – Mark B Jul 8 '13 at 15:45
  • 1
    There is no tolerance, you can use ST_Buffer to make the lines "thicker" but then you'd have to choose what point you want to represent the intersection. – Jakub Kania Jul 8 '13 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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