Merge pull request #2473 from strk/2.3.x-faster-pgraster-test
Use a smaller input file for testing dataraster 16bsi
This commit is contained in:
commit
779c5c2376
2 changed files with 8 additions and 4 deletions
BIN
tests/data/raster/dataraster-small.tif
Normal file
BIN
tests/data/raster/dataraster-small.tif
Normal file
Binary file not shown.
|
@ -117,7 +117,8 @@ if 'pgraster' in mapnik.DatasourceCache.plugin_names() \
|
||||||
# initialize test database
|
# initialize test database
|
||||||
postgis_setup()
|
postgis_setup()
|
||||||
|
|
||||||
# dataraster.tif, 2283x1913 int16 single-band
|
# [old]dataraster.tif, 2283x1913 int16 single-band
|
||||||
|
# dataraster-small.tif, 457x383 int16 single-band
|
||||||
def _test_dataraster_16bsi_rendering(lbl, overview, rescale, clip):
|
def _test_dataraster_16bsi_rendering(lbl, overview, rescale, clip):
|
||||||
if rescale:
|
if rescale:
|
||||||
lbl += ' Sc'
|
lbl += ' Sc'
|
||||||
|
@ -141,6 +142,7 @@ if 'pgraster' in mapnik.DatasourceCache.plugin_names() \
|
||||||
# as base scale and multiply by the overview factor.
|
# as base scale and multiply by the overview factor.
|
||||||
# NOTE: the overview table extent only grows north and east
|
# NOTE: the overview table extent only grows north and east
|
||||||
pixsize = 500 # see gdalinfo dataraster.tif
|
pixsize = 500 # see gdalinfo dataraster.tif
|
||||||
|
pixsize = 2497 # see gdalinfo dataraster-small.tif
|
||||||
tol = pixsize * max(overview.split(',')) if overview else 0
|
tol = pixsize * max(overview.split(',')) if overview else 0
|
||||||
assert_almost_equal(env.minx, expenv.minx)
|
assert_almost_equal(env.minx, expenv.minx)
|
||||||
assert_almost_equal(env.miny, expenv.miny, delta=tol)
|
assert_almost_equal(env.miny, expenv.miny, delta=tol)
|
||||||
|
@ -201,7 +203,7 @@ if 'pgraster' in mapnik.DatasourceCache.plugin_names() \
|
||||||
eq_(hexlify(im.view(255, 0,1,1).tostring()), '404040ff')
|
eq_(hexlify(im.view(255, 0,1,1).tostring()), '404040ff')
|
||||||
|
|
||||||
def _test_dataraster_16bsi(lbl, tilesize, constraint, overview):
|
def _test_dataraster_16bsi(lbl, tilesize, constraint, overview):
|
||||||
import_raster('../data/raster/dataraster.tif', 'dataRaster', tilesize, constraint, overview)
|
import_raster('../data/raster/dataraster-small.tif', 'dataRaster', tilesize, constraint, overview)
|
||||||
if constraint:
|
if constraint:
|
||||||
lbl += ' C'
|
lbl += ' C'
|
||||||
if tilesize:
|
if tilesize:
|
||||||
|
@ -214,9 +216,11 @@ if 'pgraster' in mapnik.DatasourceCache.plugin_names() \
|
||||||
drop_imported('dataRaster', overview)
|
drop_imported('dataRaster', overview)
|
||||||
|
|
||||||
def test_dataraster_16bsi():
|
def test_dataraster_16bsi():
|
||||||
for tilesize in ['','256x256']:
|
#for tilesize in ['','256x256']:
|
||||||
|
for tilesize in ['256x256']:
|
||||||
for constraint in [0,1]:
|
for constraint in [0,1]:
|
||||||
for overview in ['','4','2,16']:
|
#for overview in ['','4','2,16']:
|
||||||
|
for overview in ['','2']:
|
||||||
_test_dataraster_16bsi('data_16bsi', tilesize, constraint, overview)
|
_test_dataraster_16bsi('data_16bsi', tilesize, constraint, overview)
|
||||||
|
|
||||||
# river.tiff, RGBA 8BUI
|
# river.tiff, RGBA 8BUI
|
||||||
|
|
Loading…
Reference in a new issue