'Checks the compatibility of the given spatial reference object.'

def check_srs(self, source_srs):

    if isinstance(source_srs, SpatialReference):
        sr = source_srs
    elif isinstance(source_srs, self.spatial_backend.spatial_ref_sys()):
        sr = source_srs.srs
    elif isinstance(source_srs, (int, six.string_types)):
        sr = SpatialReference(source_srs)
    else:
        sr = self.layer.srs
    if (not sr):
        raise LayerMapError('No    source    reference    system    defined.')
    else:
        return sr
