'Transforms this geometry to a different spatial reference system.
May take a CoordTransform object, a SpatialReference object, string
WKT or PROJ.4, and/or an integer SRID.  By default nothing is returned
and the geometry is transformed in-place.  However, if the `clone`
keyword is set, then a transformed clone of this geometry will be
returned.'

def transform(self, coord_trans, clone=False):

    if clone:
        klone = self.clone()
        klone.transform(coord_trans)
        return klone
    if (GDAL_VERSION < (1, 7)):
        orig_dim = self.coord_dim
    if isinstance(coord_trans, CoordTransform):
        capi.geom_transform(self.ptr, coord_trans.ptr)
    elif isinstance(coord_trans, SpatialReference):
        capi.geom_transform_to(self.ptr, coord_trans.ptr)
    elif isinstance(coord_trans, (int, long, basestring)):
        sr = SpatialReference(coord_trans)
        capi.geom_transform_to(self.ptr, sr.ptr)
    else:
        raise TypeError('Transform    only    accepts    CoordTransform,    SpatialReference,    string,    and    integer    objects.')
    if (GDAL_VERSION < (1, 7)):
        if isinstance(self, GeometryCollection):
            for i in xrange(len(self)):
                internal_ptr = capi.get_geom_ref(self.ptr, i)
                if (orig_dim != capi.get_coord_dim(internal_ptr)):
                    capi.set_coord_dim(internal_ptr, orig_dim)
        elif (self.coord_dim != orig_dim):
            self.coord_dim = orig_dim
