Esempio n. 1
0
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;
}
Esempio n. 2
0
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;
}