

def test_memory_based_raster_creation(self):
    rast = GDALRaster({
        'datatype': 1,
        'width': 16,
        'height': 16,
        'srid': 4326,
        'bands': [{
            'data': range(256),
            'nodata_value': 255,
        }],
    })
    result = rast.bands[0].data()
    if numpy:
        result = result.flatten().tolist()
    self.assertEqual(result, list(range(256)))

dataset/ETHPy150Open django/django/tests/gis_tests/gdal_tests/test_raster.py GDALRasterTests.test_memory_based_raster_creation/original