[gdal-dev] Possible SyncToDisk() bug in 1.5

Martin Chapman mchapman at texelinc.com
Sun Dec 16 19:21:08 EST 2007


Also, because SHX is not picked up rendering or looping through geometries
in a shape file is now very slow.  I will look into the bug further and see
if I can find the problem.  Is anyone else seeing this issue in 1.5 or
noticed shape files being slow?

 

Martin Chapman

Chief Software Architect

Fortified Datacom Inc.

http://www.fortifieddatacom.com

mchapman at fortifieddatacom.com

303-324-1065

 

From: gdal-dev-bounces at lists.osgeo.org
[mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Martin Chapman
Sent: Sunday, December 16, 2007 5:16 PM
To: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] Possible SyncToDisk() bug in 1.5

 

This code:

 

--

string sLayerName = (string)
m_pDataSource->GetLayer(0)->GetLayerDefn()->GetName();

string sSQL = "CREATE SPATIAL INDEX ON " + sLayerName;

m_pDataSource->ExecuteSQL((const char*) sSQL.c_str(), NULL, "");

--

 

throws an error in the file/function below on the line -
hSHP->sHooks.FFlush( hSHP->fpSHX );

because hSHP->fpSHX is NULL.  The question is why is hSHP->fpSHX NULL when
it used to pickup the shape index file.  Anyone else have this problem with
1.5? 

 

\gdal\ogr\ogrsf_frmts\shape\ogrshapelayer.cpp

 

OGRErr OGRShapeLayer::SyncToDisk()

 

{

    if( bHeaderDirty )

    {

        if( hSHP != NULL )

            SHPWriteHeader( hSHP );

 

        if( hDBF != NULL )

            DBFUpdateHeader( hDBF );

        

        bHeaderDirty = FALSE;

    }

 

    if( hSHP != NULL )

    {

        hSHP->sHooks.FFlush( hSHP->fpSHP );

        hSHP->sHooks.FFlush( hSHP->fpSHX );  ka-boom!

    }

 

    if( hDBF != NULL )

        hDBF->sHooks.FFlush( hDBF->fp );

 

    return OGRERR_NONE;

}

 

Best regards,

 

Martin Chapman

Chief Software Architect

Fortified Datacom Inc.

http://www.fortifieddatacom.com

mchapman at fortifieddatacom.com

303-324-1065

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20071216/dff38681/attachment.html


More information about the gdal-dev mailing list