Search code examples
vectorautocaddwgmaptiler

AutoCAD drawing (DWG) to map tiles


Rendering large DWG files as such has shown performance degradation to large extent. Planning to use the concept of map tiles using leaflet. Need some pointers/information on how to convert DWG files to map tiles.


Solution

  • After too many hours, searching everywhere for a solution to convert DWG/DXF files using any automated command line tool, finally I found QCAD.org.

    And that works even on Windows, MacOS and Linux.

    After a quick look in documentation, I found the section for command line tools.

    They are:

    dwg2bmp, dwg2png, dwg2jpeg, dwg2tiff, dxf2png, dxf2jpeg, dxf2tiff
    

    and the awesome:

    dwg2maptiles and dxf2maptiles
    

    Using this tool, they came up with a beautiful sample using leaflet.js: http://qcad.org/res/map/

    The project is OpenSource, but this scripts are only avaliable at QCAD Professional edition. You can use the free open source QCAD Community Edition by downloading the trial version for your platform (Win, Mac, Linux) and then remove the QCAD Professional add-on running in trial mode. Alternatively, you may compile your own package from sources.

    PS: I'm very happy to support the project buying a professional copy.