[gdal-dev] GSoC GDAL DWG Support [Week 4]

Борзых Александр Андреевич 191980 at niuitmo.ru
Wed Jun 22 15:14:15 PDT 2016


Hello, Even
Sorry for late response. I have been working on tasks you have listed, but didn’t manage to answer your question:

Part of geometry attributes will be in OGR Simple style, and things that can’t be fitted there - will be just as feature style strings (as DXF driver does).

By the way, I have applied your fix to build on gcc 4.7, replaced VSI... Functions with VSI…L instead.

Best regards,
Alexandr Borzykh




>Александр,
>
>Great to see your progress.
>
>Here's a commit to fix a compilation issue:
>https://github.com/rouault/gdal_libopencad/commit/0f2a5205ad5e4aaa55283c43c134a3683a60c8b6
>
>> 
>> Also, I would like to know which DWG file things would devs like to see in
>> Feature attributes fields? Now it contains Thickness, Color (RGB),
>> CADGeometryType, ExtendedEntityData (not supported by library yet).
>
>Regarding styling, do you intend exposing it as attributes or using OGR 
>feature style strings like in the DXF or the Teigha DWG driver ?
>> 
>> - All libopencad's file I/O was rewritten using VSIF.
>
>I tried the following :
>
>from osgeo import gdal, ogr
>data = open('libopencad/tests/data/r2000/triple_circles.dwg').read()
>gdal.FileFromMemBuffer('/vsimem/foo.dwg', data)
>ds =ogr.Open('/vsimem/foo.dwg')
>
>and got a crash :
>
>Program received signal SIGSEGV, Segmentation fault.
>_IO_fread (buf=0x7fffffffd5b0, size=1, count=6, fp=0x0) at iofread.c:43
>43	iofread.c: Aucun fichier ou dossier de ce type.
>	in iofread.c
>(gdb) 
>(gdb) bt
>#0  _IO_fread (buf=0x7fffffffd5b0, size=1, count=6, fp=0x0) at iofread.c:43
>#1  0x00007ffff52fb13c in VSIFRead (pBuffer=0x7fffffffd5b0, nSize=1, nCount=6, 
>fp=0x0) at cpl_vsisimple.cpp:230
>#2  0x00007ffff5433a79 in CADFileStreamIO::Read (this=0xa48750, ptr=0x7fffffffd5b0, 
>size=6) at cadfilestreamio.cpp:109
>
>So I saw you indeed use the VSIF API, and not the VSIF*L API (VSIFOpenL(), 
>etc....). The former is just a wrapper around the C standard FILE operations, 
>while the later uses the GDAL virtual file system handlers to have in-memory 
>file (/vsimem/), compressed file (/vsizip/, /vsitar/) or remote files (/vsicurl/)
>
>Other things I've tried :
>
>* numerous compiler warnings.
>
>* "valgrind --leak-check=full ogrinfo -ro -al -q 
>libopencad/tests/data/r2000/triple_circles.dwg" shows some memory leaks
>
>* "test_ogrsf -ro libopencad/tests/data/r2000/triple_circles.dwg": a number of 
>errors regarding taking into attribute & spatial filters (see 
>OGRDXFLayer::GetNextFeature() for the usual way of taking into account 
>filters), and finally a crash. test_ogrsf is a kind of "conformance" testing for 
>OGR drivers. You need to "cd apps; make test_ogrsf" to build it.
>
>
>Even
>
>-- 
>Spatialys - Geospatial professional services
>http://www.spatialys.com


More information about the gdal-dev mailing list