Is this correct??
Eric J. Peters
eric at i...
Mon Apr 8 13:32:51 EDT 2002
Hi-
While digging through some code to try to isolate a problem I'm
having, I found the following code in ogrlinestring.cpp:
OGRBoolean OGRLineString::Equal( OGRGeometry * poOther )
{
OGRLineString *poOLine = (OGRLineString *) poOther;
if( poOther == this )
return TRUE;
if( poOther->getGeometryType() != getGeometryType() )
return FALSE;
// we should eventually test the SRS.
if( getNumPoints() != poOLine->getNumPoints() )
return FALSE;
for( int iPoint = 1; iPoint < getNumPoints(); iPoint++ )
{
if( getX(iPoint) != poOLine->getX(iPoint)
|| getY(iPoint) != poOLine->getY(iPoint)
|| getZ(iPoint) != poOLine->getZ(iPoint) )
return FALSE;
}
return TRUE;
}
My question is regarding the loop at the end. iPoint goes from 1 to
getNumPoints() -- shouldn't this be from 0 to getNumPoints()? Am I missing
something, or is this a bug in the GDAL code?
Thanks,
-Eric.
--
Eric J. Peters
eric at i...
==
More information about the Gdal-dev
mailing list