OGRLineString functions setPoint and addPoint forces linestring to 3D
|Reported by:||alexhagenzanker||Owned by:||warmerdam|
The method addPoint(OGRPoint* point) always causes the linestring to become 3D. Even if the added point is a 2D point.
The reason is that the method setPoint(i,x,y,z)which is called by addPoint(point) always causes the linestring to become 3D even if z has the value of 0.0.
This could be desired behaviour for setPoint, after all the user took the effort to specify the 3rd dimension.
It cannot be desired behaviour for addPoint.
I'd suggest to either fix addPoint or setPoint, addPoint being the safest option.
void OGRLineString::addPoint( OGRPoint * poPoint )
if(poPoint->getCoordinateDimension() < 3)
setPoint( nPointCount, poPoint->getX(), poPoint->getY());
setPoint( nPointCount, poPoint->getX(), poPoint->getY(),