| 1 | == GDAL DWG file format support == |
| 2 | |
| 3 | == Short description == |
| 4 | |
| 5 | An implementation of new OGR Driver with capability to read DWG file format. Driver will be based on a newly written open-source library under X/MIT license. |
| 6 | |
| 7 | == Introduction == |
| 8 | |
| 9 | Current state of GDAL: There is DWG support, which contradicts with GDAL ideology: |
| 10 | 1. It depends on third-party library (Teigha), which is not OpenSource. |
| 11 | 2. Current DWG Driver is not built-in in GDAL 2.0 by default, and is not maintained for years. |
| 12 | 3. There are a few external libraries, that can provide abilities to work with DWG, but they can’t be used in GDAL for a variety of reasons: |
| 13 | * libdwg - abandoned project |
| 14 | * libredwg - GPLv3 incompatible with GDAL X/MIT |
| 15 | * libdxfrw - GPLv2 incompatible with GDAL X/MIT. |
| 16 | |
| 17 | To sum up, there is a real need in creating a driver without any third-party dependencies, which can go forward with X/MIT ideology. |
| 18 | |
| 19 | == Main ideas == |
| 20 | |
| 21 | '''Write a new library to read DWG files''' |
| 22 | |
| 23 | * Library should be written in an easy-to-extend style, so every DWG/DXF version can be handled easily. |
| 24 | * Library should provide a clear API how to interact with it, and an easy method to write OGR Driver based on it. |
| 25 | * Library should has an abstract data model for all DWG/DXF files of any version (so, DXF format also could be added to the library). |
| 26 | |
| 27 | '''GDAL Driver''' |
| 28 | |
| 29 | Implement a new DWG driver for OGR, which will work with libopencad. The driver should support some options, i.e. explode blocks, etc. All DWG/DXF header variables should be mapped to driver metadata. Reading the DWG/DXF files should be organised via GDAL VSI/CPL functions. The libopencad sources needed for driver will be merged to GDAL sources. |
| 30 | |
| 31 | '''Plan & Timeline''' |
| 32 | |
| 33 | 1. Before May 28: |
| 34 | Complete creating File Map of DWG R2000, which will allow to easily get Geometries from specific layer. |
| 35 | Reading Layers attributes. |
| 36 | Write google tests for file opening errors handling, reading geometries of each type. |
| 37 | |
| 38 | 2. May 28 - June 4: |
| 39 | Write google tests for correct opening of large files with big amount of geometries and layers. |
| 40 | |
| 41 | 3. June 5 - June 12: |
| 42 | Implement doxygen, start working on library API and internal methods description. |
| 43 | |
| 44 | 4. June 13 - June 20: |
| 45 | Implement reading of attributes for geometries and objects, as they are separated from geometries/objects data structures. |
| 46 | |
| 47 | 5. June 21 - June 28: |
| 48 | Start writing OGR Driver (DXF driver will be as an example) for DWG file format handling and integrating libopencad in it. |
| 49 | Add basic OGR style support. |
| 50 | |
| 51 | 6. June 29 - July 6: |
| 52 | Start adding DWG R13-14 formats support to libopencad. |
| 53 | Working on last week tasks. |
| 54 | |
| 55 | 7. July 7 - July 14: |
| 56 | End of adding DWG R13-14 formats support to libopencad. |
| 57 | Start testing new OGR DWG Driver for its capabilities to Identify DWG files, reading features from it. |
| 58 | |
| 59 | 8. July 15 - July 22: |
| 60 | Implement Valgrind to find actual memory leaks in libopencad, as well as in OGR Driver and fix them. |
| 61 | |
| 62 | 9. July 23 - 30: |
| 63 | Start writing documentation for new OGR Driver. |
| 64 | Start code refactoring of libopencad codebase for production level. |
| 65 | |
| 66 | 10. July 31 - August 7: |
| 67 | End code refactoring. |
| 68 | End writing documentation. |
| 69 | Write GDAL Autotests for new driver. |
| 70 | |
| 71 | 11. August 8 - August 15: |
| 72 | Fix possible errors found by autotests. |
| 73 | Sumbit a pull request to GDAL Trunk. |
| 74 | |
| 75 | |
| 76 | == Future ideas == |
| 77 | |
| 78 | Support for writing ability - creating CAD files is more complicated than reading, but with good library/driver architecture it will be possible without any painful refactoring. |
| 79 | Not all DWG format versions will be handled during GSoC, so adding support to them will also be a good extension. |
| 80 | |
| 81 | |
| 82 | == Project progress == |
| 83 | |
| 84 | '''All progress made can be viewed there:''' |
| 85 | |
| 86 | Github: https://github.com/sandyre/libopencad (CAD support library) |
| 87 | |
| 88 | Blog: http://gsoc2016gdaldwg.blogspot.ru |