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 layer that contains a master line (one big polyline) and a another layer that contains "break lines". I need to be able to split the master line at the intersection of each of these break lines.

I'm looking for a PostGIS 1.5 version of ST_Split. If I could upgrade to 2.0 I would but can't really do that at this point in time.

I thought this would be relatively easy but can't seem to find anything; or when I do it's just related to polygons being split with polylines.

Note A spatialite answer is OK

share|improve this question
up vote 2 down vote accepted

ST_Difference(master_line, break_lines) looks like it'll do this for you:

# SELECT ST_AsText(ST_Difference(
                       ST_GeomFromText('LINESTRING(0 100, 0 -100)'),
                       ST_GeomFromText('LINESTRING(-100 0, 100 0)')));
 MULTILINESTRING((0 100,0 0),(0 0,0 -100))
(1 row)
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.