Commentary based on initial technical feedback

Other posts: technical advice so far, and statement of the original problem

Why is it so difficult to work with CAD data with free software? Fundamentally, because DWG is a proprietary format with an interesting history. The proprietary format helps Autodesk to maintain control of its business, its effective monopoly of  the computer-aided design market. In twentieth-century thinking, it makes complete business sense for Autodesk to keep control of its format, because effective competition would threaten its business. In a networked world, this has some unfortunate unintended consequences.

Control of the DWG format creates lots of extra business, not only for Autodesk but for other companies. Selling support, setting up databases, selling complex and specialised systems to help people design and manage and plan changes to the built environment. All of this takes up time, takes up resources, and in this case, takes up public funding.

I’m writing this blog because I’d like to work on a simple web-based map application that could help the users of buildings at the University to be more aware of their impact on their environment; how much energy is being used, how much space is being occupied, what impact small changes may turn out to have. Energy and space use are factored into research funding. It costs people more to do their research if they are using energy or space inefficiently, because they have to ask for more “overheads” when they apply for funding. We get more buck for less bang, as our American friends might put it.

This started as a work project; it has now spilled over into free time. I’d like to create a proof-of-concept prototype that can illustrate the benefits, so I can find some more financial support to carry on working on this. There is the potential to save quite a lot of money. Yet i’m stalled at the beginning, due to the difficulty of working with a proprietary format with free and open source software.

 

 

 

 

 

 

Initial technical feedback

I asked for responses to the original problem post from Schuyler Erle (who did something like this years ago) and Frank Warmerdam (the main author of GDAL/OGR)

GDAL should be able to read DXFs; the version current in macports was out of date. To make sure I get DXF reading support, I should rebuild from source. (I can’t do this on this new OSX Lion machine, because one can no longer download XCode without handing over credit card details to Apple – but that is another story).

The current trunk version of GDAL has some work on reading “simple features” (e.g. converting CAD data into GIS data) . It depends on the Open Design Alliance  software library to read and write DWGs which is not open source, which is why it doesn’t make its way into packaged, easily installable versions of GDAL.

There is some promising work on a LibreDWG library that could replace it, but it is still at the “check it out of git” stage, requiring a high level of technical clue and commitment.

To get something working in the short term (reading the DXF 2000s converted with Teigha File Converter) I am best off on Linux, in this case Ubuntu. Ubuntu GIS would help to get started without struggling too much to build things from scratch. To get started:

Try editing

/etc/apt/sources.list.d/ubuntu-gis.list

And adding the following lines:

deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu YOUR_UBUNTU_VERSION_HERE main
deb-src http://ppa.launchpad.net/ubuntugis/ppa/ubuntu YOUR_UBUNTU_VERSION_HERE main

Or, if that doesn’t work:

deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu YOUR_UBUNTU_VERSION_HERE main
deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu YOUR_UBUNTU_VERSION_HERE main

So that’s what I’ll try in the short term; install Ubuntu on the Mac, replacing Lion, adding Ubuntu GIS. Remember that all this is just in an attempt to look at the DWG data and try to get a handle on what is in it.

Introduction – Adventures in AutoCAD data

I’ve been talking with some lovely people who are very receptive to opening their data. Floor plans, detailed building management information, energy use, space occupation.

The data owners are working with proprietary software and data formats. Their data is in AutoCAD .dwg format. I can only work with free and open source software on this project – so no Windows and no AutoCAD.

I want to:

  • look at the contents of the files (as an image and as structured data)
  • extract parts of the DWGs into an open reusable format
  • georeference the DWGs and add the georeferences back into the originals
  • later, automate updates to the extracted versions DWGs are updated

Right now I cannot even read the contents of the files. So I am asking for help; this blog is an attempt to document the process of discovery. In an ideal world the blog will consist of two posts – this one and then the conclusion.

The story so far:

I’ve only seen Windows based tools that provide a way to get a view-only pretty picture of the structured data. So tried  GDAL, the fundamental free and open geographic data format conversion tool.

The documentation I can see suggests GDAL will read older versions of the DWG format – “DXF 2000” and convert data a wide choice of open data formats.

I tried a tool called Teigha File Converter (not open source, but made available without a charge or a registration) and it converted my DWGs into DXF 2000.

When I ran GDAL’s ogr2ogr tool over the Teigha output (the default GDAL that came via macports), it said that DXF wasn’t supported. Do I have to re-build GDAL from source with a particular plugin? I don’t have the right level of technical clue, or all the required components on OSX, though I could assemble all these with a bit of hand-holding.

Contemplation

I have no idea what to expect from the DWG data. Will there be enough implicit structure in it to tell what are walls, what are staircases, windows etc, so that we can produce a simpler clearer version of the data to use in an online mapping application automatically?

I have no idea why there is no support for DWG in GDAL. Is it a question of format restriction – one has to pay a license fee to Autodesk to even be able to use the format? Or is it a question of lack of demand leading to lack of attention – e.g. no-one is offering to pay for the format to be added to GDAL, and it’s a particularly un-fun and l0ng job that really needs to be paid to be done? Is there suppressed demand due to the overhead of getting this working or integrating it into free GIS software? Or am I simply missing something obvious?

Rather than just write to the developers and to people I know who’ve done something like this before, asking for advice, I thought I’d send them links to this blog instead, in the hope that others may find some of it useful – inspired by Mac OSX tips.

Please let me know what I should be making clearer; or leave a comment, or email me (jo.walsh@ed.ac.uk) if you feel you can help, and I’ll post everything I learn here, hopefully leading to a neat solution and some nice-looking and useful open data.