python - gdalwarp causes ERROR 6: PNG driver doesn't support 6 bands in gdal2tiles -
i've problem gdalwarp function.
what i've done:
i built .vrt file 6 .tif images:
gdalbuildvrt -overwrite /input/base.vrt /home/tiles/base/*.tif
my gdalinfo looks that:
driver: vrt/virtual raster files: temp/vrt/base.vrt /home/tiles/base/17_base_1.tif /home/tiles/base/17_base_2.tif /home/tiles/base/17_base_3.tif /home/tiles/base/17_base_4.tif /home/tiles/base/17_base_5.tif /home/tiles/base/17_base_6.tif size 60007, 40007 coordinate system `' origin = (468000.000000000000000,5510000.000000000000000) pixel size = (0.100000000000000,-0.100000000000000) corner coordinates: upper left ( 468000.000, 5510000.000) lower left ( 468000.000, 5505999.300) upper right ( 474000.700, 5510000.000) lower right ( 474000.700, 5505999.300) center ( 471000.350, 5507999.650) band 1 block=128x128 type=byte, colorinterp=red band 2 block=128x128 type=byte, colorinterp=green band 3 block=128x128 type=byte, colorinterp=blue band 4 block=128x128 type=byte, colorinterp=undefined
everything works fine until now. i've done next building 1 big .tif image .vrt file:
gdalwarp -multi -r cubic -s_srs epsg:25832 -t_srs epsg:3857 -cutline /shp/17.shp -crop_to_cutline -dstalpha -co compress=lzw /input/base.vrt /output/base.tif
but, gdalinfo output tif looks like:
driver: gtiff/geotiff files: temp/base.tif size 47849, 25603 coordinate system is: projcs["wgs 84 / pseudo-mercator", geogcs["wgs 84", datum["wgs_1984", spheroid["wgs 84",6378137,298.257223563, authority["epsg","7030"]], authority["epsg","6326"]], primem["greenwich",0, authority["epsg","8901"]], unit["degree",0.0174532925199433, authority["epsg","9122"]], authority["epsg","4326"]], projection["mercator_1sp"], parameter["central_meridian",0], parameter["scale_factor",1], parameter["false_easting",0], parameter["false_northing",0], unit["metre",1, authority["epsg","9001"]], axis["x",east], axis["y",north], extension["proj4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"], authority["epsg","3857"]] origin = (952949.608269182615913,6400383.903813457116485) pixel size = (0.154577105681076,-0.154574816517696) metadata: area_or_point=area image structure metadata: compression=lzw interleave=pixel corner coordinates: upper left ( 952949.608, 6400383.904) ( 8d33'37.77"e, 49d44' 3.40"n) lower left ( 952949.608, 6396426.325) ( 8d33'37.77"e, 49d42'40.66"n) upper right ( 960345.968, 6400383.904) ( 8d37'36.96"e, 49d44' 3.40"n) lower right ( 960345.968, 6396426.325) ( 8d37'36.96"e, 49d42'40.66"n) center ( 956647.788, 6398405.114) ( 8d35'37.37"e, 49d43'22.03"n) band 1 block=47849x1 type=byte, colorinterp=gray band 2 block=47849x1 type=byte, colorinterp=undefined band 3 block=47849x1 type=byte, colorinterp=undefined band 4 block=47849x1 type=byte, colorinterp=undefined band 5 block=47849x1 type=byte, colorinterp=alpha
and bands causes error in gdal2tiles function:
error 6: png driver doesn't support 6 bands. must 1 (grey), 2 (grey+alpha), 3 (rgb) or 4 (rgba) bands.
does has idea happens? why band 2-4 undefinied , band 1 gray? think should gdalinfo .vrt file (=> rgba)?
Comments
Post a Comment