Beispiel #1
0
    def test_ggb_shape_from_rio_dataset(self):
        img, geobox = ut.create_test_image()
        kwargs = {
            'driver': 'MEM',
            'width': img.shape[1],
            'height': img.shape[0],
            'count': 1,
            'transform': geobox.transform,
            'crs': geobox.crs.ExportToWkt(),
            'dtype': img.dtype.name
        }

        with rio.open('tmp.tif', 'w', **kwargs) as ds:
            new_geobox = GriddedGeoBox.from_rio_dataset(ds)

            self.assertTrue(new_geobox.shape == img.shape)
Beispiel #2
0
    def test_ggb_shape_from_rio_dataset(self):
        img, geobox = ut.create_test_image()
        kwargs = {
            "driver": "MEM",
            "width": img.shape[1],
            "height": img.shape[0],
            "count": 1,
            "transform": geobox.transform,
            "crs": geobox.crs.ExportToWkt(),
            "dtype": img.dtype.name,
        }

        with rio.open("tmp.tif", "w", **kwargs) as ds:
            new_geobox = GriddedGeoBox.from_rio_dataset(ds)

            self.assertTrue(new_geobox.shape == img.shape)