4

Just a follow-up to this question QGIS: Line to polygon conversion. Not sure do i have to continue there itself...

We are currently digitizing a geological map...which has 36 features in total. Some of them will be polygons & some of them will be polylines. What we normally do is, we will capture all the features as polylines in Mapinfo and later we will enclose some of the features as polygons and will keep the others as polylines itself, so that we don't have to digitize the same features again and again.

I am arguing with some of colleaques...that most of the work can be done in QGIS itself.I knew very well the limitations of a OSS. But still, i find it very difficult to understand..why a basic conversion like "Line to Polygon" is not running properly..which is very much needed for our work.

I've almost tried everything. Polygonize, Line to Polygons (even thru SAGA), Convex Hull. But still, the result is not satisfactory (Pls refer the image).

Is it one of the limitations of qgis ? If so, then we have to drop the idea of using qgis for our project (which i don't want to happen). Is there any other alternative in QGIS itself ?

enter image description here


What we'll do in Mapinfo is...

1) Will capture all the linear features as polylines (Obvious, isn't :) )

2) Then we'll capture some other geological features as polylines as well (with different attributes). Most of the time, the linear features will overlap with the geological features. So we will make use of the previously digitized Linear features layer & merge them with this - Geology layer. Of course, with the change in attributes.

3) Now, using the "Enclose" command in Mapinfo...all the properly snapped polylines will be converted to Polygons.

QGIS doesn't work like Mapinfo layer thing..i.e..Point + Lines + Polygons..all in one layer. So we have two options Either capture the features as polygons first & then convert it to polylines. But, it's so cumbersome & will create lot of confusion. B'coz so many linear features will be overlapping on this polygon/geology features. It'll be very difficult to delete the unwanted polylines late...once we have converted it to polylines.

Or otherwise, we have to go with mapinfo's procedure. Polyline -> Polygons..That's what we are trying to do & so far the results are unsatisfactory (as in the image)

Update: As answered by nhopton, i tried the same "Polygonize" in 2.2 Valmiera (which was installed with all the components thru OSGEO installer) and it worked fine. I think the problem might be with python components or something.. The outcome was shown in the image.

Note: The second map in the image was done in a system wherein which QGIS 2.2 was installed as standalone sw.

enter image description here

4
  • Could you share more of your workflow (in MapInfo), so we can understand exactly what it is you are doing? What did you want the polygons to look like in your example? Curious about the way you create lines - are they individual lines, each with their own attributes?
    – Simbamangu
    Apr 17, 2014 at 8:32
  • @Simbamangu I've just added the details you have asked at the end question itself. Hope u are familiar with geological maps. We have to capture so many features like rock distribution, fault lines, contacts etc...
    – joseph_k
    Apr 17, 2014 at 9:41
  • Thanks for the edit - much better picture of workflow. However, still unclear on why the results are unsatisfactory - could you share an image of what you expect to see, using the same data in your example?
    – Simbamangu
    Apr 17, 2014 at 10:21
  • @Simbamangu Yep...juz check the image at the end of this thread & the answer too. Now it's working. But still i can't figure out the reason for this. Might be an installation issue. Thanks for your time...cheers..
    – joseph_k
    Apr 17, 2014 at 10:48

2 Answers 2

5

You might like to have a look at this document, which shows an example of using the Polygonizer to make a geological map.

http://confound.me.uk/maps/ppv4.pdf

After some recent problems, in my version of QGIS (2.3.0-Master, from Ubuntugis) the Polygonizer is now working again. Search for 'Polygonize' in the Processing Toolbox.

N.

8
  • nhopton...Thanks for your answer. But as i've mentioned in my question & in the image itself, i've tried Polygonize command (Processing -> Commander). But the result was like that of the one in the image.
    – joseph_k
    Apr 17, 2014 at 9:15
  • 1
    Would you check the Polygonizer using this shapefile? dl.dropboxusercontent.com/u/45121071/laxlines.zip
    – nhopton
    Apr 17, 2014 at 9:39
  • Great man..Thanks again... 1) I've tried the laslines in Dufour 2. And the result was Algorithm Polygonize starting... Polygonize algorithm requires shapely module! 2) Then again i tried it with Valmeira 2.2. And the result was Algorithm Polygonize starting... Float division by zero See log for more details
    – joseph_k
    Apr 17, 2014 at 10:10
  • 3) But i had a doubt. That previous command was on run the system where QGIS was installed as the standalone QGIS sw...not from OSGEO installer. So again i tried it with my system where all the python modules + GRASS + SAGA etc...all were installed thru OSGEO installer. MG....it worked perfectly. Not only the laslines, but also my own files were converted. Still i've to go check with some other shapefiles. Do u know why this has happened ? Is it due to the installation thing ?
    – joseph_k
    Apr 17, 2014 at 10:11
  • Until lately I was getting messages similar to yours with 'Polygonize', I think this was something to do with the version of Shapely installed on my system. But the problem has disappeared in recent upgrades. Pleased to hear that it's working for you too. N.
    – nhopton
    Apr 17, 2014 at 10:22
1

I used the MapInfo Discover Polybuilder utility from 2008-10 with great success. I am currently building maps in QGIS using the same basic methodology.

Polybuilder uses lines and labels, combining the two to create labelled polygons when needed, but still relying on lines as the basic building block. Switching back and forward between lines and polygons was simple. This makes sense, as geologists don't draw polygons, they draw lines, which eventually stitch together to form polygons.

In QGIS 2.18.10 I use just two utilities - "Lines to polygons" and "Join attribute by location", so far without any problems. Making sure topology is good is critical, which appears to be the problem in the figure. No easy answer, sorry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.