I'm looking for the fastest way to detect whether a given linestring overlaps another linestring. Here's my current approach.<div><br></div><div>Given two tables: r1 and s1, both containing a geo_data column of linestring, first narrow the data (taking advantage of gist index) with r1.geo_data && s1.geo_data, then use ST_Contains to see if s1 is overlapping r1, i.e. r1.geo_data && s1.geo_data and ST_Contains(ST_Buffer(r1.geo_data,ST_Length(r1.geo_data)*.002),s1.geo_data)</div>
<div><br></div><div>This approach works, but it's extremely CPU-intensive and slow. Is there a better approach?</div><div><br></div><div>Thanks,</div><div><br></div><div>--</div><div>Adam McManus</div>