Esempio n. 1
0
def test_gtiff_profile_compress():
    assert DefaultGTiffProfile()()['compress'] == 'lzw'
Esempio n. 2
0
def test_gtiff_profile_nodata():
    assert DefaultGTiffProfile()()['nodata'] == 0
Esempio n. 3
0
def test_gtiff_profile_tiled():
    assert DefaultGTiffProfile()()['tiled'] == True
Esempio n. 4
0
def test_gtiff_profile_blockysize():
    assert DefaultGTiffProfile()()['blockysize'] == 256
Esempio n. 5
0
def test_gtiff_profile_format():
    assert DefaultGTiffProfile()()['driver'] == 'GTiff'
Esempio n. 6
0
def test_gtiff_profile_interleave():
    assert DefaultGTiffProfile()()['interleave'] == 'band'
Esempio n. 7
0
import numpy as np
import rasterio
from rasterio.profiles import DefaultGTiffProfile

BANDS = 3
WIDTH = 17
HEIGHT = 11

array = np.arange(0, BANDS * WIDTH * HEIGHT, dtype='uint16')
array.shape = (BANDS, WIDTH, HEIGHT)

with rasterio.Env():
    profile = DefaultGTiffProfile(width=WIDTH,
                                  height=HEIGHT,
                                  dtype=rasterio.uint16,
                                  count=3)

    with rasterio.open('example.tif', 'w', **profile) as dst:
        dst.write(array)
Esempio n. 8
0
def test_gtiff_profile_dtype_override():
    assert DefaultGTiffProfile(dtype='uint16')['dtype'] == rasterio.uint16
Esempio n. 9
0
def test_gtiff_profile_other():
    assert DefaultGTiffProfile(count=3)['count'] == 3
Esempio n. 10
0
def test_gtiff_profile_dtype():
    assert DefaultGTiffProfile()['dtype'] == rasterio.uint8
Esempio n. 11
0
def test_gtiff_profile_format():
    assert DefaultGTiffProfile()['driver'] == 'GTiff'
    with pytest.warns(RasterioDeprecationWarning):
        assert DefaultGTiffProfile()()['driver'] == 'GTiff'