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

In QGIS, I would like to split the polylines in a layer loaded in the workspace with the points in another loaded layer. If a point intersects a polyline, this polyline should be transformed into two polylines...

I've read that this could be done with grass but i have no idea how to do it with layers (SHP)loaded in the QGIS workspace.

share|improve this question
up vote 2 down vote accepted

You can see solutions using GRASS here

There's also another option with Spatialite. The newest version 4.0 has a function LinesCutAtNodes() which does what you want. You feed it a linestring geometry and a point geometry, and it returns a linestring split wherever a point exactly intersect a vertex on the line. The points have to intersect vertices on the line, so you should do snap() first to get the points to exactly intersect the line vertices.

share|improve this answer
Thanks for your answer. I do not have SQLIte to use those functions but i do use Postgis. In fact the layers i loaded in the QGIS Map Canvas are loaded from postgis. Is there any similar function in Postgis? I've seen that st_snap() exists but nothing similar to Spatialites LinesCutAtNodes()? – Egidi Feb 1 '13 at 17:18
In PostGIS you could probably use a combination of ST_Line_Locate_Point() to find the fractional distance along your linestring for each point, then ST_Line_Interpolate_Point() to find the new node. and finally ST_AddPoint() to stick a the node into the linestring. THis would all have to go into a function with a "for each" loop. – Micha Feb 2 '13 at 18:35

For PostGIS ST_Split is the maching function. You can use ST_Snap to add some tolerance into the calculation

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.