[Qgis-user] Keeping layers of an imported DXF file into QGIS

Andreas Neumann andreas at qgis.org
Mon Nov 9 07:23:44 PST 2020


Hi Luc,

QGIS has two ways of importing/exporting DXF:


   - the native QGIS way (uses the libdxfrw library and can be accessed in
   QGIS through menu "Project --> Import/Export --> Import Layers from
   DWG/DXF")
   - and through the OGR library (using the menu Layer --> Add Layer -->
   Add Vector Layer)

Drag and Drop of the DXF file from the file manager to QGIS uses the OGR
method, btw.

Both approaches read 3D data perfectly fine and the 3D data can be used in
3D views in QGIS - so absolutely no need to go through Blender, unless you
want to create renderings there.

The QGIS native way imports the original DXF layers into separate QGIS
layers, but will separate out by geometry type, the OGR way imports all
similar geometry types into a single table, but the table contains the
original DXF layer name and you can filter and style your data using the
layer name attributes. Note that in QGIS a category or symbology rule can
also be toggled, so it almost acts like a "layer" - you can switch on/off a
category or symbology rule.

Both approaches co-exist and have their advantages/disadvantages, but in
general, the native QGIS way is the better way to import your DXF - and it
will keep your layers. However, the QGIS native way imports the DXF into a
Geopackage and then the data is actually a copy of the DXF file, while the
OGR way is a "live" access to your DXF file, so any changes in the DXF are
also seen in QGIS, while with the native import, you'll have to re-import
your DXF file.

Personally, I always always prefer the native way with the import, with the
drawback that you have to remove and re-add the file after you have changes
in the DXF file. But I recommend you to try both options and see which of
the two works better for you.

Hope this helps,

Andreas

On Mon, 9 Nov 2020 at 15:24, Luc Le Blanc <speleoluc at gmail.com> wrote:

> Hi,
>
> My cave survey freeware exports DXF files organized in multiple layers
> for survey stations, station names, line plot, wall lines, etc.
>
> A user tells me that when he imports this DXF into QGIS, everything
> gets merged into 3 layers containing station markers (small
> triangles). lines (line plot, passage widths, walls, altogether) and
> station names.
>
> Is it possible for QGIS to neatly import a layered DXF file into
> corresponding layers, respecting the initial organization?
>
>
> --
> Luc Le Blanc
> http://www.speleo.qc.ca/Auriga
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



-- 

--
Andreas Neumann
QGIS.ORG board member (treasurer)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20201109/e2603bd6/attachment.html>


More information about the Qgis-user mailing list