'Returns the coordinate dimension of the Geometry.'

def _get_coord_dim(self):

    if (isinstance(self, GeometryCollection) and (GDAL_VERSION < (1, 5, 2))):
        if len(self):
            return capi.get_coord_dim(capi.get_geom_ref(self.ptr, 0))
    return capi.get_coord_dim(self.ptr)
