<pre><font style="font-family:arial,helvetica,sans-serif" size="2">Using this statement,<br>SELECT ST_AsGeoJSON(ST_Split(ST_GeomFromText('LINESTRING(0 0,2 0,2 2,0 2,0 0)'), ST_GeomFromText('LINESTRING(0 2,2 0)')))<br>
<br>I get this,<br>{"type":"GeometryCollection","geometries":[{"type":"LineString","coordinates":[[0,0],[2,0]]},{"type":"LineString","coordinates":[[2,0],[2,2],[0,2]]},{"type":"LineString","coordinates":[[0,2],[0,0]]}]}<br>
<br>Since this is basically a square being cut with a diagonal, I'm expecting only two linestrings. However, I end up with three linestrings, with two of them "split" at (0,0). ST_Split seems to always split the first/last point of a closed linestring.<br>
<br>Does anyone know why this happens?<br><br>Thanks.</font><br></pre>