Multilines to Polygons with GRASS and Quantum GIS

Tonight I had a set of GPS forestry block line features to convert into polygons for a friend. The file had been created using a merge tool in QGIS and incidentally made multiline features. That might have been fine, until we wanted to convert them to polygons. The ftools vector conversion in QGIS broke the polygons at the start of each new line feature. Hmm…

Time for topology tools. I created a simple mapset using the GRASS tools in QGIS, imported the line_in.shp into a new GRASS layer. I then used the snapping generalisation tool with a 5m tolerance to make sure my line features “closed” properly for polygon building. Then I used the line to boundary conversion tool to get the final step done. After loading the layer into my view, I was able to save it as a new shapefile for sending on to the client.

Bang, done. In 20 minutes, including trial and error, I was done. That was quicker than it took me to try to write up the problem for QGIS bug tracker 😉

Here’s a quick (and rough) video showing what I did (even a couple mistakes). Go full screen to see the detail at full res.

Published by

Tyler Mitchell

Product and marketing leader, author and technology writer in NoSQL, big data, graph analytics, and geospatial. Follow me @1tylermitchell or get my book from http://locatepress.com/gpt

%d bloggers like this: