Geometry* Ring::cloneAs( const Geometry::Type& newType ) const { if ( newType == TYPE_LINESTRING ) { LineString* line = new LineString( &this->asVector() ); if ( line->size() > 1 && line->front() != line->back() ) line->push_back( front() ); return line; } else return Geometry::cloneAs( newType ); }