Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 929
Shanadas Avatar asked Dec 19 '22 11:12

Shanadas


2 Answers

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.

like image 61
Luiz Vaz Avatar answered Jan 05 '23 10:01

Luiz Vaz


The easiest approach may be to save your DWG files as PDF and use MapTiler to create the raster tiles and leaflet viewer for you.

You can render such PDF by drag&drop into MapTiler while choosing the "raster" profile - just follow the video tutorial: https://youtu.be/9iYKmRsGoxg?list=PLGHe6Moaz52PiQd1mO-S9QrCjqSn1v-ay

If you need to assign coordinates for later on placing markers or polygons on specified position over the DWG tiles - it is possible with advanced tiles.

If you need help with using MapTiler - write details and provide sample file you need to process to https://www.maptiler.com/support/community/.

If you data are sensitive or you need a guarantee on the answering of your request you seek directly the support from us, the authors of MapTiler.

like image 28
MapTiler Avatar answered Jan 05 '23 09:01

MapTiler