2

I am working on a huge CAD-map that I am supposed to convert into a GIS map. Currently I am trying to convert the symbols used for survey points (see below) into polygons, of which I could calculate a central point as the real representation in GIS. Line representation of the CAD-Symbol in GIS

I got rid of all the unnecessary lines, and wanted to convert the remaining line octagon into a polygon by use of the "Line to Polygon tool", but that does not work, apparently, because every edge is a single line (see below). However the lines appear to be correctly snapped to each others end points.

Octagon of lines. Strings represent the entity handle of each line.

I tried several workarounds, but nothing really worked. Any ideas?

  • You did not mention how you tried to convert the lines to polygons but did you try the Lines to polygons tool? :) – Joseph Mar 14 '18 at 10:06
  • Are the lines snapped correctly among each other. Make sure they are connected (snapped) especially after deleting unwanted lines. – ahmadhanb Mar 14 '18 at 10:06
  • You are right. Sorry. Edited the original post. – akra-kachi Mar 14 '18 at 10:13
  • Try to use Convert lines to polygons under Processing -> SAGA tools in QGIS and see if it will give you a correct result. – ahmadhanb Mar 14 '18 at 10:17
  • @ahmadhanb: No that does not work either. Difference to the QGIS-Geoalgorithm is, that SAGA creates a "polygon" out of each single line and the QGIS algorithm creates no polygons. – akra-kachi Mar 14 '18 at 10:31
2

I just did this last week and know your pain. The SAGA-tool didn't work for me as desired, since it seems to be the same as the standard QGis-tool.

But if you resort to the toolbox -> QGis -> vector geometry tools -> polygonize you should achieve your goal. Just make sure that all the lines are closed before trying to convert them (use pedit in AutoCAD).

Also, be sure to work on shape-files instead of dxf.

  • Thanks for the hint. This works ... sort of, however the few useful information from the attribute table line.shp imported from the CAD are lost in this process. Is their any way of avoiding this loss? – akra-kachi Mar 14 '18 at 11:07
  • Not that I know of, sorry. – Erik Mar 14 '18 at 11:34
  • 1
    Ok. Found a work around: Create the polygons as described by Erik. Than go to -> Vector -> Data managment tools -> Join attributes by location. Select your polygon layer as the target layer and the line layer as the Join layer. In my case it was necessary to select "Take attributes of first located feature" as well. This way I can at least copy the basic layer information from the CAD and one of the Entity handles. – akra-kachi Mar 24 '18 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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