[gdal-dev] ogr2ogr bug with dwg file

Xian Chen chenxian at walkinfo.com.cn
Thu Jul 11 00:33:36 PDT 2013


Hi all,

Finally I've got a chance to report something after one-month silence as a
newcomer in the community.
After running ogr2ogr (on Windows 7) to convert a dwg file into shape files,
I received an error message as follows:
/    Warning 6: Normalized/laundered field name: 'ExtendedEntity' to
'ExtendedEn'
    Warning 6: Normalized/laundered field name: 'EntityHandle' to
'EntityHand'
    ERROR 1: Attempt to write non-linestring (POINT) geometry to ARC type
shapefile.

    ERROR 1: Terminating translation prematurely after failed
    translation of layer entities (use -skipfailures to skip errors)/

And then the application exited abnormally.  I read the source code and
found that the last error message was produced by an error from
TranslateLayer(). The application terminated there without calling
OGRCleanupAll()

Therefore I tested reading dwg file on OGR. My conclusion is that
OGRCleanupAll() has to be called explicitly before termination of the whole
application, otherwise an abnormal termination (due to stack overflow??)
will occur.

Is there anyone else having the similar experience? I am thinking of adding
"OGRCleanupAll();" before "exit(1);" in the following ogr2ogr.cpp code:

/            if( !TranslateLayer( poDS, poPassedLayer, poODS, papszLCO, 
                                 pszNewLayerName, bTransform, poOutputSRS,
bNullifyOutputSRS,
                                 poSourceSRS, papszSelFields, bAppend,
eGType,
                                 bOverwrite, eGeomOp, dfGeomOpParam,
papszFieldTypesToString,
                                 nCountLayerFeatures, bWrapDateline,
poClipSrc, poClipDst,
                                 bExplodeCollections, pszZField, pszWHERE,
pfnProgress, pProgressArg))
            {
                CPLError( CE_Failure, CPLE_AppDefined, 
                          "Terminating translation prematurely after
failed\n"
                          "translation from sql statement." );

                exit( 1 );
            }/

Best regards,

Xian



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/ogr2ogr-bug-with-dwg-file-tp5065611.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list