1

I am using the GRASS v.in.dxf tool from the GRASS plugin to import some contours in QGIS. Everything seems fine, but the tool does not import all the contours. There are no additional options in this tool. There are no selected features. Has anybody had this problem? I am using QGIS 2.18.11 in Windows 10 32 bits.

The reason I am using this tool is because with the "Add vector layer" option the polyline elevations are not imported, see for example (Importing 3D DXF file into QGIS with z information as attribute value?. I have donde this before using the v.in.dxf tool in the processing toolbox, but it seems is broken in QGIS 2.18.11

This is the original dxf, loaded using the Add vector layer option;

enter image description here

This is the imported dxf using the v.in.dxf GRASS tool:

enter image description here

The dxf file can be downloaded here: https://drive.google.com/open?id=0BxWWBxW4QOfdVWl3R3BMemJPTlk.

For the record, I created the file using ogr2ogr, because it seems it's the only way to export elevation to a dxf.

  • Could you provide screenshots of how your dxf file looks and whats imported as well, or provide the dxf file? You surely know, that dxf file can be opened in QGIS with 'Add Vector Layer...' (like shapefile e.g.), is that an alternative? – Jochen Schwarze Aug 17 '17 at 6:43
  • Thanks for your answer @JochenSchwarze. I hace updated my question. – Ernesto561 Aug 17 '17 at 12:32
1

Not sure if it answers your question, but some observations. Bad news first of all, I could not reproduce your issue in QGIS 2.18.11 and QGIS 2.14.17 LTR, both GRASS 6 and 7. Any import worked fine (see screenshots below). The only difference between QGIS 2.14.17 and 2.18.11 is that in QGIS 2.18.11 the 'List of Layers to import' seems mandatory and cannot left blank (in order to import ALL layers, as one might expect). The region extent is chosen more or less accidently and does not seem to matter, and I imported all objects into one layer:

Configuration v.in.dxf QGIS 2.14.17 LTR:

enter image description here

Result:

enter image description here

Configuration v.in.dxf QGIS 2.18.11 LTR:

enter image description here

(I did not type the layer list by hand, it's created on the python console via ','.join(['%s'%i for i in range(680, 2380,20)]))

Result:

enter image description here

Note that the Z coordinate of the vertices is always 0, but that the elevations are kept in the layer attribute, from where they can be used for further processing (the same as if it was imported with 'Add Vector Layer').

  • Thanks. In QGIS 2.14.3 I used to type "all" in the list of layers, according to the v.in.dxf GRASS documentation. I"ll check if this is the issue and update if it works. – Ernesto561 Aug 17 '17 at 13:58
  • By the way, the issue occurred when I used the v.in.dxf tool from the GRASS toolbox plugin, not the one from the processing plugin, but it would be great if I can run the processing version. – Ernesto561 Aug 17 '17 at 14:07
  • My problem was the list of layers, as you pointed out. It seems that for some reason the parameter related to the list of layers changed between versions. It should import all the layers by default. I filed a bug: issues.qgis.org/issues/17023. Thanks again for your help. – Ernesto561 Aug 18 '17 at 0:36
2

I'm one of the v.in.dxf developers. I tried your DXF file and the module worked fine. By default, this module imports all layers into multiple layers in a new vector map. v.in.dxf found 85 layers in your DXF file and imported them into 85 different layers (dblinks in GRASS terms). I think what happened is when QGIS imported back the 85 layers from GRASS into a QGIS layer, it didn't import all the layers. If you want to import all layers into one layer, use the '-1' Import all objects into one layer flag.

  • Thanks for your answer. I think the optional inputs were improved in QGIS 2.18.13 for this tool. – Ernesto561 Jun 21 '18 at 15:49

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.