Skip to content

Commit

Permalink
Don't try to render bands > 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom MacWright committed Apr 28, 2011
1 parent 91fd903 commit a3309d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion raster2mb
Expand Up @@ -59,7 +59,7 @@ def writemb(index, data, dxsize, dysize, bands, mb_db):
else:
tmp = tempdriver.Create('', tilesize, tilesize, bands=bands)

tmp.WriteRaster( 0, tilesize-dysize, dxsize, dysize, data, band_list=range(1, bands+1))
tmp.WriteRaster(0, tilesize-dysize, dxsize, dysize, data, band_list=range(1, bands+1))
tiledriver.CreateCopy('tmp.png', tmp, strict=0)
query = """insert into tiles
(zoom_level, tile_column, tile_row, tile_data)
Expand Down Expand Up @@ -131,6 +131,8 @@ if __name__ == '__main__':
parser.usage()

bands = dataset.RasterCount
if bands > 3:
bands = 3
if bands == 3 and tileformat == 'png':
from Numeric import zeros
xsize = dataset.RasterXSize
Expand Down

0 comments on commit a3309d9

Please sign in to comment.