コード例 #1
0
def test_gtiff_profile_compress():
    assert DefaultGTiffProfile()()['compress'] == 'lzw'
コード例 #2
0
def test_gtiff_profile_nodata():
    assert DefaultGTiffProfile()()['nodata'] == 0
コード例 #3
0
def test_gtiff_profile_tiled():
    assert DefaultGTiffProfile()()['tiled'] == True
コード例 #4
0
def test_gtiff_profile_blockysize():
    assert DefaultGTiffProfile()()['blockysize'] == 256
コード例 #5
0
def test_gtiff_profile_format():
    assert DefaultGTiffProfile()()['driver'] == 'GTiff'
コード例 #6
0
def test_gtiff_profile_interleave():
    assert DefaultGTiffProfile()()['interleave'] == 'band'
コード例 #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)
コード例 #8
0
ファイル: test_profile.py プロジェクト: yangmaoer/rasterio
def test_gtiff_profile_dtype_override():
    assert DefaultGTiffProfile(dtype='uint16')['dtype'] == rasterio.uint16
コード例 #9
0
ファイル: test_profile.py プロジェクト: yangmaoer/rasterio
def test_gtiff_profile_other():
    assert DefaultGTiffProfile(count=3)['count'] == 3
コード例 #10
0
ファイル: test_profile.py プロジェクト: yangmaoer/rasterio
def test_gtiff_profile_dtype():
    assert DefaultGTiffProfile()['dtype'] == rasterio.uint8
コード例 #11
0
ファイル: test_profile.py プロジェクト: yangmaoer/rasterio
def test_gtiff_profile_format():
    assert DefaultGTiffProfile()['driver'] == 'GTiff'
    with pytest.warns(RasterioDeprecationWarning):
        assert DefaultGTiffProfile()()['driver'] == 'GTiff'