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

Heres what i want to achieve: i have a roading polyline layer (singlepart ie has several features per road, grouped by an id field), and i want to (after merging the parts) find the mid point of the resulting lines. This is for roads geolocation.

The problem is that the qgis dissolve function only works on polygons.

Ive tried:
a) mmqgis plugin "create label layer" (handles multiparts nicely)
b) buffer road lines to 1m then dissolve by roadid, then ftools centroids

Both of which give a 'sort of' result, but the main problem is that the point is not actually on the road line. Is there a way to either force polygon centroids to be within the buffer polygon, or alternatively, some way to actually join the polylines and find mid points directly.

Note that while there are (a small number of) 'Y' shaped lines, most of the multipart lines start and end at the same place, (maybe gridifyed to 1cm).

share|improve this question
Probaly no can do for the polyline disolve/midpoint route at present, but surely theres a way to force polygon centroids to be inside the polygon?? – Peter May 19 '11 at 0:25
PostGIS ST_Line_Interpolate_Point() should work. But the Y-shaped ones will be tricky. – underdark Jun 1 '11 at 22:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.