<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi Paolo,</p>
<p>I'll let Jürgen comment in more detail.</p>
<p>But their approach is different to the libdxfrw approach. Also - again the main bottleneck would be the limited OGR features styles. Also, the approach Jürgen will do will generate label/symbology rules as good as possible and provide caching in a SpatiaLite or geopackage file behind the scenes. </p>
<p>But it is good to have choice. If we can enable this in our "Add Vector Layer" dialog as well, people could then decide whether they want the OGR DXF/DWG driver or the QGIS native one through libdxfrw.</p>
<p>Greetings,</p>
<p>Andreas</p>
<p>On 2016-08-17 08:32, Paolo Cavallini wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Hi all,<br /> does this have any impact on our developmant?<br /> All the best.<br /><br /> -------- Messaggio Inoltrato --------<br /> *Week 12 Report [Final] blogpost link<br /> <<a href="http://gsoc2016gdaldwg.blogspot.ru/2016/08/week-12-report-final.html">http://gsoc2016gdaldwg.blogspot.ru/2016/08/week-12-report-final.html</a>>*<br /><br /><br /> Brief description of the idea.<br /><br /> The aim of my project was to extend GDAL supported formats with DWG.<br /><br /><br /> The state of the project as it was BEFORE your GSOC.<br /><br /> There was a DWG support, but it was not built-in by default, and GDAL<br /> Driver was based on third-party library Teigha (which is not X/MIT<br /> licensed, not even close).<br /><br /><br /> The addition that your project brought to the software.<br /><br /><br /> Libopencad (GDAL CAD Driver engine)<br /><br /> Overview<br /><br /> Libopencad is a library written in C++11, which provides a way to<br /> read/write CAD (DWG/DXF/DXFB) files. It was designed to have a uniformal<br /> API to work with any CAD files. It has a base class - CADFile.<br /> Inheriting this class it's possible to create a 'driver' for any CAD<br /> format, all you need to do - is to overwrite interface functions like<br /> 'GetGeometry(index)', and others. Now it has an implementation for<br /> DWG2000 (R15), but only for read.<br /><br /> Library comes with 'cadinfo' utility, which prints out everything<br /> library can get from file - header variables, CAD custom classes,<br /> presented layers and geometries with their attributes.<br /><br /> Internal structure<br /><br /> Library presents CAD objects in different ways - base class CADObject<br /> and other CAD...Object classes are exact analogues of how DWG format<br /> stores information about its objects. CADGeometry, and other classes<br /> which inherits it, are done for API access to CAD...Object classes.<br /><br /> Library supports 3 modes of reading - READ_ALL (means everything which<br /> can be extracted from CAD file will be read) READ_FAST (skipping some<br /> kind of meanless information - linetypes, CRC check, etc), READ_FASTEST<br /> (only geometries reading, additional info is skipped).<br /><br /> When parsing the file, library does not store any information it does<br /> not need. First, it reads file meta-information, and creates a file map.<br /> It only stores some info about presented layers, and header variables.<br /> Then, when calling application uses CADLayer.GetGeometry(index), it<br /> actually reads a geometry from file, using prepared file map. Sometimes<br /> it will be slower than having everything you have read in cache, but<br /> gives you more flexibility what you want to store in memory, and what<br /> you wont.<br /><br /> Library also has special classes which incapsulates I/O functions, so<br /> it's possible to reimplement them for your needs - by default it uses<br /> std::fstream, but you can make it possible to work with network by make<br /> a class inherited from CADFileIO.<br /><br /><br /> Supported geometries list:<br /><br /> Point, Circle, Ellipse, Arc, Text, Solid, Spline, Line, Polyline 2D,<br /> Polyline 3D, LWPolyline, Ray, Raster (Images), MText, MLine, XLine,<br /> Polyface Mesh, 3DFace.<br /><br /><br /><br /><br /> GDAL CAD Driver<br /><br /> Overview<br /><br /> GDAL CAD Driver uses libopencad as a datasource. Not everything that<br /> libopencad can read from file is mapped into OGR infrastructure, but it<br /> will be done in near future. Current features are:<br /><br />  1.<br /><br />     OpenOptions are presented with 2 options:<br /><br /> - MODE - READ_ALL/READ_FAST/READ_FASTEST (means the same as library<br /> OpenOptions).<br /><br /> - ADD_UNSUPPORTED_GEOMETRIES_DATA (YES/NO) - unstable feature, if some<br /> of the objects cannot be mapped into OGR representation (or its just not<br /> implemented yet), it will be presented as a CADUnknown object -<br /> OGRFeature without geometric representation, but with basic info -<br /> geometry type, some additional params.<br /><br />  2.<br /><br />     CAD header variables are mapped into metadata.<br /><br />  3.<br /><br />     Unlike DXF driver, CAD driver stores vector data in the appropriate<br />     layers (not all entities in single layer).<br /><br />  4.<br /><br />     Raster subdatasets are also supported.<br /><br />  5.<br /><br />     Coordinate system is extracted from DWG file (if it is presented in<br />     accordance with ESRI Docs for DWG files), or from %FILENAME%.prj<br />     file in the same directory.<br /><br />  6.<br /><br />     CAD Geometry attributes mapping is completely done into<br />     OGRLayerDefn. So, any ACAD BlockReference attributes will be seen in<br />     OGRLayerDefn.<br /><br /><br /> Add all the links (hopefully permanent) to access the relevant code and<br /> documentation for the user to get started with testing your application.<br /><br /> During the planning stage, I decided to separate my project into 2<br /> parts: separated CAD formats support library (named libopencad), and<br /> GDAL driver, which uses it. Library can be used by itself for any<br /> reason, and will be maintained after GSoC.<br /><br /><br /> Links:<br /><br /> Libopencad repository<br /> <<a href="https://github.com/sandyre/libopencad">https://github.com/sandyre/libopencad</a>>(installation is described in<br /> REAME.MD)<br /><br /> Libopencad + GDAL fork <<a href="https://github.com/sandyre/gdal_libopencad">https://github.com/sandyre/gdal_libopencad</a>><br /><br /> Blog with all reports and notices <<a href="http://gsoc2016gdaldwg.blogspot.ru/">http://gsoc2016gdaldwg.blogspot.ru/</a>><br /><br /> PR with my work into GDAL-trunk. <<a href="https://github.com/OSGeo/gdal/pull/145">https://github.com/OSGeo/gdal/pull/145</a>><br /><br /> GDAL Wiki driver page <<a href="https://trac.osgeo.org/gdal/wiki/DWG_driver">https://trac.osgeo.org/gdal/wiki/DWG_driver</a>><br /><br /><br /> A slide / image should serve to show the main elements of your project.<br /><br /> Raster and vector layers by the same driver (left - ArcGIS, right -<br /> QGIS): image link <<a href="https://pbs.twimg.com/media/Cm2N_-nVIAA8jBn.jpg">https://pbs.twimg.com/media/Cm2N_-nVIAA8jBn.jpg</a>><br /><br /> A little comparison between original data source (ACAD) and QGIS with<br /> new DWG driver: image link <<a href="https://pbs.twimg.com/media/CmwXIBnWcAAz22X.jpg">https://pbs.twimg.com/media/CmwXIBnWcAAz22X.jpg</a>><br /><br /> Blockreference attributes mapping into OGRLayerDef: image link<br /> <<a href="https://pbs.twimg.com/media/CocvxggWYAACiIg.jpg">https://pbs.twimg.com/media/CocvxggWYAACiIg.jpg</a>><br /><br /><br /> Best regards,<br /><br /> Alexandr Borzykh<br /><br /> _______________________________________________<br /> Qgis-developer mailing list<br /><a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></div>
</blockquote>
<p> </p>
<div> </div>
</body></html>