Opened 14 years ago

Closed 13 years ago

#2989 closed enhancement (wontfix)

improve reading of DWG to equal DNG functionality

Reported by: dcarreira Owned by: jef
Priority: major: does not work as expected Milestone: Version 1.6.0
Component: Vectors Version:
Keywords: dwg, dgn, cad Cc: cavallini@…
Must Fix for Release: No Platform: Windows
Platform Version: Awaiting user input: no

Description

QGIS already reads DGN files (at least v7), mixing all geometry types in one single layer.

One can then filter each geometry type by querying the dgn layer. For example, to filter all lines you can use this query:

"Type" IN ('3','4','12','14','16','15')

The layer will have only lines after this query is applyed. To know which type codes correspond to each geometry type you can lookup on certain web pages, like:

http://www.gdal.org/ogr/drv_dgn.html
http://www.gisdevelopment.net/technology/gis/techgi0011.htm


I attached an example dgn file where you can exercise this kind of filtering.

You can also by this means, get all text elements:
"Type" = '17'

Note that QGIS does not reset the symbology according to the query results. So the default line symbology is kept and nothing is visible since the layer now holds only points. To workaround this limitation, you have only to change the symbology type to "Categorized", and then back to "Single Symbol". QGIS will pick up on the geometry type and propose the default point symbol. At this stage you can see the text points.

Since all DGN attributes that are captured by OGR are available to QGIS you can also show the texts by labeling the points.

Finally, you can export each geometry type to separate shapefiles. Later on, you can work these shapefiles and further filter elements by level (the dgn's equivalent to dwg's layers).

This process allows QGIS to work with CAD data directly, without requiring external tools, like ogr2ogr. Extending this support to dwg would be a breakthrough!

Attachments (1)

0243-P0140-04.7z (197.6 KB ) - added by dcarreira 14 years ago.
dgn example file

Download all attachments as: .zip

Change History (2)

by dcarreira, 14 years ago

Attachment: 0243-P0140-04.7z added

dgn example file

comment:1 by pcav, 13 years ago

Resolution: wontfix
Status: newclosed

DWG is a proprietary format. No free and open source software can read it effectively. DXF, on the other hand, is supported through OGR.

Note: See TracTickets for help on using tickets.