@staticmethod
    def create_spatial_ref(crs):
        # pylint: disable=broad-except

        osr.UseExceptions()
        try:
            spatial_ref = osr.SpatialReference()
        except Exception:
            raise DatasetError('No spatial reference done for %s' % str(crs))
        try:
            spatial_ref.ImportFromWkt(crs)
            return spatial_ref
        except Exception:
            pass
        try:
            matchobj = re.match(r'EPSG:(\d+)', crs)
            epsg_code = int(matchobj.group(1))
            spatial_ref.ImportFromEPSG(epsg_code)
            return spatial_ref
        except Exception:
            return None
Create a spatial reference system for projecton crs.
dataset/ETHPy150Open GeoscienceAustralia/agdc/src/abstract_ingester/dataset_record.py/DatasetRecord.create_spatial_ref