11

Which GIS support DXF and/or DWG (preferably read&write)?

Update: Are there any open source GIS supporting these or similar CAD files?

Support of CAD files generally seems to be problematic. What are the biggest issues/problems concerning DXF/DWG support in GIS?

14 Answers 14

7

Problem with DWG and DXF formats is that Autodesk does not publish full specifications.

DXF Format
DXF ASCII format is well known and most of packages can read it.
Binary DXF is partially documented and since it is not primary AutoCAD format, it is rarely supported. For more details see here: AutoCAD DXF

DWG Format
DWG format is read by most GIS packages, but usually with some constraints.
Two most used libraries that can read and write DWG files are one that can be licensed from AutoDesk and other is from non profit consortium Open Design Alliance (ODA). AutoDesk library is limited for use in products that do not compete with AutoDesk products, while ODA library does not support all DWG features.

ODA library was catching up with changes introduced by AutoDesk until 2006 when AutoDesk sued ODA and some software vendors for copyright infringement. Lawsuit was settled earlier this year and result is that ODA library cannot write 100% compatible DWG files. More information can be found on Open Design Alliance (ODA) site and on Wikipedia article on DWG file format

7

FME will convert data between formats and has a good story for transforming CAD > GIS. See: http://www.safe.com/solutions/GIS/CADtoGIS.php

Disclosure - I do work for Safe Software, the creators of FME. But it is ideal for this scenario, otherwise I wouldn't suggest it.

As to problems with CAD into GIS, one other issue is geometry types. CAD typically has types of geometry that GIS doesn't support. For example special items like cells/blocks; general (but not GIS common) items like arcs, splines, etc; 3D geometry like blocks, faces, textures.

Sometimes your GIS/translator will handle these, sometimes it will force them into alternate geometry (eg arc > line stroking), sometimes it will just drop the features.

1
  • I'm just starting to experiment with FME to translate DWGs to SQL Server, and so far, I'm lovin' it. Commented Nov 8, 2010 at 4:37
6

What are the biggest issues

I dont have the time (right now, ill try edit later) to provide a detailed answer, but the main issue with CAD data is typically, CAD technicians create plans with no regard to coordinate systems. i.e. They plot around the origin of 0, 0, = I've work on plenty of projects where people dont understand that a bit more work is involved when you get given some CAD data and they assume it will align up with all of your spatial layers.

Then there is the issue of importing CAD annotation...

1
  • 1
    I used to work in an architecture company that mandated us to have 2 sets of drawings. The first will be based on 0,0 full detailed plan. The second would be a skimmed version that we aligned properly with the proper lat / longs
    – dassouki
    Commented Sep 12, 2010 at 16:24
5

GRASS GIS 6.4 supports import and export of 2D and 3D DXF through v.in.dxf and v.out.dxf. In GRASS-Addons there is a new prototpype for a DWG import module, based on LibreDWG.

3

Kosmo (http://www.opengis.es/)can read and write to DXF/DWG, when writing it uses/creates a layer called Default, it also has some basic CAD tools implemented.

Hope it works

3

I'm a bit surprised nobody mentioned autocad map 3d. It is autocad with extra support for gis data, and contains many routines to convert from dwg (or use simultaneously) to the formats supported by fdo, including spatial databases and eg shapefiles.

2

ArcGIS can import AutoCAD data quite easily. You can use the georefencing tools if need be but often it is necessary to export the drawing to an ArcGIS format in order to utilize the spatial adjustment tools. You can also export to DXF and DNG but i am not sure how usable the files are on the AutoCAD end. I know i can open and edit them but have had problems with exporting attributes correctly.

2

GDAL/OGR supports read&write for DXF, so any GIS that uses GDAL(QGIS, GRASS) should allow you to at least use that format. The only time i really use the CAD formats is exporting data for one of our engineers so i don't have much experiecne other than exporting into DXF.

There is another DWG/DXF driver for GDAL available the offers write only support, but i have absolutely no experience with it.

2

If you're just trying to get to a gis-friendly format from a DWG/DXF creator, you might try Bentley Microstation (probably with the 'Map' extension), it will import & read dwg/dxf files just fine, and can export those elements & features to a shapefile or something else you could read into a GIS package. It's a bit 'closer to the source' solution but maybe more reliable since you're getting a GIS-friendly output from the start, instead of a GIS-based reader to try and accommodate all the weirdness that can come with these file formats.

2

An update on this, which for me at least is very relevant. I just got a phone call from a happy CAD user, which must be a tautology.....

To export dxf from QGIS (and get said happy CAD user) use the plugin MMQGIS. The CAD users grumble a lot if you export a fully formed CSV by the layer saveas option in QGIS (note this thread Getting list of coordinates for points in layer using QGIS?). The saveas dxf option in 1.7.4-3 and trunk was not satisfactory either, despite the reported improvements in trunk.

How to spread the joy;

Have your shapefile in the projection of UTM and a modern map gid for your region. Export it to this if you must, don't expect OTFR to do the heavy lifting for you. Fetch the mmqgis from the plugin manager, you may find that mmqgis does not fall aphabetically where it should, last time I looked it had made it to the QGIS contributed repo. And you may find that mmqgis is turned off by default, manage the plugin and turn it on.

Operate the plugin and choose the Geometry Export to CSV File, for a polyline it creates two files, you need to logical with your names and let it use the attributes suffix for the.... attributes. This increases the joy of the end user when they can easily interpret what they have been given.

By all accounts the import to AutoCAD is a breeze, with no of that tedious "parsing" of columns or descent into manual manipulation of data.

So many thanks to all the QGIS team, the mmqgis plugin and GIS.SE for allowing me to write my very own help file for when I forget how to do it!!

As far as importing from AutoCAD, I am still waiting for the joyous operator to pay a bit more attention and try to resolve the same issue which is noted in this thread by another GIS trooper - Last edited information missing when used QGIS - Dxf to Shp

2

We've been using GIS with AutoCAD and sending files back to GIS users for years and it works fine as long as one follows the proper transfer protocols. It's not rocket science. Two years ago I mapped off of 47 aerial photographs and sent them to an Arc?GIS user. We talked before transferring data and I got back my data overlaid on Geoeye in a .dwg format that I could read as a .jpg. The most recent version of AutoCAD, AutoCAD Map 3D will read and work with .shp files and Leica GIS raster GIS. Engineers work differently and most of the time what I get from them we have to convert into real world coordinates, and add to export .dxf generic CAD files provided from clients that use GIS. We have done this for years without the slightest difficulty and no complaints from those with whom we send our data. BUT AutoCAD IS different, it thinks differently and it doesn't have a GIS data model and that's already been discussed. We used Arc/INFO 15 years ago so perhaps that helps.

1

If possible dont mix DWG/DXF and GIS, it causes headaches. If you have to do it then FME is not that bad tool for it. You just have to think differently, no more geometry + attributes , you have stuff on your layers + tags + importand information as text with line pointing where that text should be ...

So if you give your GIS data to users and you are going to insert it back to your GIS systems be very , very clear how to users should store data into cad file.

1

I'm using CAD data in ArcGIS quite a lot. The main issues to me are:

  • no coordinate system at all, you can then georeference the CAD drawing using only two points, unless you export it to a different format
  • Block references, a lot of times you have to use 3rd party software like Draftsight (Open Source) to explode CAD features to be able to then switch of certain layers in ArcGIS
  • External refernces - it takes a while to get use to how to handle them it all comes with time and experience ;)
  • Polygons that are not really what we - GIS users - understand as Polygons, and they never translate right

Apart from that ArcGIS does the job and it's getting better in time. Main formats that are supported are DWG and DXF but if you have Data Interoperability extension you can handle weird things like DWF as well - but during translation you'll most likely loose whole attribute table and layers.

1

Here is another solution for visualizing and exporting CAD into GIS formats: Geobide SDK.

Free versions of the tools are available.

  • Geomap tool allows visualizing several CAD layers.
  • Geoconverter is the tool to perform transformation into different GIS formats. Also in English.

Your Answer

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

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