OGRGeometry *OGRCompoundCurve::clone() const { OGRCompoundCurve *poNewCC = new OGRCompoundCurve; poNewCC->assignSpatialReference( getSpatialReference() ); poNewCC->flags = flags; for( int i = 0; i < oCC.nCurveCount; i++ ) { poNewCC->addCurve( oCC.papoCurves[i] ); } return poNewCC; }
OGRCompoundCurve* OGRCurve::CastToCompoundCurve(OGRCurve* poCurve) { OGRCompoundCurve* poCC = new OGRCompoundCurve(); if( poCurve->getGeometryType() == wkbLineString ) poCurve = CastToLineString(poCurve); if( !poCurve->IsEmpty() && poCC->addCurveDirectly(poCurve) != OGRERR_NONE ) { delete poCC; delete poCurve; return NULL; } poCC->assignSpatialReference(poCurve->getSpatialReference()); return poCC; }