6b1035d56eca9b7af4abe1a81565667b0bf2fb47,io/eolearn/io/local_io.py,ExportToTiff,execute,#ExportToTiff#Any#,208

Before Change


            dst_transform = src_transform
            dst_width, dst_height = width, height

        with rasterio.open(self._get_file_path(filename, create_dir=True), "w", driver="GTiff",
                           width=dst_width, height=dst_height,
                           count=channel_count,
                           dtype=image_array.dtype, nodata=self.no_data_value,
                           transform=dst_transform, crs=dst_crs,
                           compress=self.compress) as dst:

            if dst_crs == src_crs:
                dst.write(image_array)
            else:
                for idx in range(channel_count):
                    rasterio.warp.reproject(
                        source=image_array[idx, ...],
                        destination=rasterio.band(dst, idx + 1),
                        src_transform=src_transform,
                        src_crs=src_crs,
                        dst_transform=dst_transform,
                        dst_crs=dst_crs,
                        resampling=rasterio.warp.Resampling.nearest
                    )

        return eopatch


class ImportFromTiff(BaseLocalIo):

After Change


        path = self._get_file_path(filename, create_dir=True)

        if "*" in path:
            for ts_idx, ts in enumerate(eopatch.timestamp, start=1):
                path = path.replace("*", f"{ts.strftime("%d%b%YT%H%M%S)")}")
                image_array = image_array[(ts_idx - 1) * channel_count:ts_idx * channel_count, ...]
                channel_count = eopatch.shape[-1]
                self._export_tiff(image_array, path if os.path.splitext(path)[-1] else path+".tif", channel_count,
                                  dst_crs, dst_height, dst_transform, dst_width, src_crs, src_transform)
        else:
            self._export_tiff(image_array, path, channel_count,
                              dst_crs, dst_height, dst_transform, dst_width, src_crs, src_transform)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: sentinel-hub/eo-learn
Commit Name: 6b1035d56eca9b7af4abe1a81565667b0bf2fb47
Time: 2020-09-23
Author: william.ouellette@gmail.com
File Name: io/eolearn/io/local_io.py
Class Name: ExportToTiff
Method Name: execute


Project Name: shibing624/pycorrector
Commit Name: 61781b939bfaad37bc4ff506cd52183748e0de0d
Time: 2019-07-19
Author: 507153809@qq.com
File Name: pycorrector/seq2seq/train.py
Class Name:
Method Name: train


Project Name: bokeh/bokeh
Commit Name: 3e802d4f61abf9fb1b88add829b76f1e309f9957
Time: 2017-02-16
Author: mattpap@gmail.com
File Name: tests/examples/examples_report_plugin.py
Class Name: ExamplesTestReport
Method Name: pytest_sessionfinish


Project Name: pyinstaller/pyinstaller
Commit Name: 0ad7b32e8f67ad66c659408cd53e39b704af3f67
Time: 2015-09-18
Author: mzibr.public@gmail.com
File Name: PyInstaller/utils/release.py
Class Name:
Method Name: sign_source_distribution