[Shapelib] possible bug when reading the boundaries ?
route at CAE.COM
Wed May 19 09:09:16 PDT 2004
I'm investigating using ShapeLib instead of our own library because of
I think I found a bug in the code for reading the bounds of a shape file in
at line 448, you have :
fread( pabyBuf, 100, 1, psSHP->fpSHX );
meaning that you are reading informations from the shx file.
But after, you are reading the bounds with :
if( bBigEndian ) SwapWord( 8, pabyBuf+36 ); //line 480
memcpy( &dValue, pabyBuf+36, 8 );
psSHP->adBoundsMin = dValue;
it means that the bounds are read from the SHX file, but according to the
specifications, the bounds are in the SHP file.
So, I think you should move the reading of the boundaries before the line
Can you confirm ?
Thanks in advance,
More information about the Shapelib