My team is working on an application that has a map feature, and we want to extend this feature greatly. Among other things, we want the user to be able to load a CAD drawing, and place it on the map. The map is just a single image right now, but we want a more advanced and flexible solution, like eg. tile based. Some of our users have showed us some CAD drawings (DWG) they want to use, and they are absolutely huge, so we are afraid that performance will be bad. I have snooped around and found that (eg.) bing maps support map tile overlays, and I guess that converting the huge CAD drawings to overlayed map tiles could make performance much better, while still maintaing a certain level of control, like clicking layers on and off. But how can I convert the CAD drawings to map tiles from within our application? Is there any API out there that can help with that? In C#?

  • opensource GDAL might be usefull or FME (www.safe.com) – simplexio May 13 '16 at 11:46
  • You will need some kind of reference between the CAD files and the real world. If no real world coordinate system has been used, you need to know real world coordinates of the drawing origin (x=0 and y=0), and of at least two other points. – AndreJ Aug 5 '16 at 6:04

The MapTiler is tool for creating the map tiles for bing, google maps, leaflet or openlayers.

To process the CAD files you may need to save it first as a PDF. If geographic coordinates are used in the CAD then export to GeoPDF. Alternatively you could export the data from the CAD software as an image such as TIFF/GeoTIFF or JPEG.

MapTiler will open such files and create the tiles and even sample viewers for you. The existing geocoordinates are loaded automatically. If the file is missing location info then it can be assigned visually from the graphical user interface.

If you develop a desktop application then you could probably agree on redistribution rights of the MapTiler binaries together with you application. If you develop a web application then the MapTiler Pro can be integrated easily.

Your code in C# can call the maptiler.exe directly and use it as the rendering core for the tiles. All functions of the software are available as parameters on the command-line so the process can be fully automated and hidden to your customers. You can make your own frontend.

The size of the input file is not an issue. MapTiler can render tiles for detailed maps of whole countries. The PDF/GeoPDF support has been recently improved (in MapTiler 0.6.1 and newer) to support huge PDFs generated by AutoCAD, Microstation and other CAD software tools.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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