<div dir="ltr">Hello<div><br></div><div>I trying to make geotiff from float array . when I try to set geotransform information I get this error : </div><div><font color="#ff0000" style="background-color:rgb(255,255,255)">"Dataset does not support the AddBand() method."<br>
</font></div><div><br></div><div>The part of my code that i used to make geotiff listed below (the part of code that error occurred ):</div><div><br></div><div><br></div><div><div>poDriver=GetGDALDriverManager()->GetDriverByName(pszFormat);</div>
<div>poDstDS = poDriver->Create( outStr.c_str(), outWidth, outHeight, 1,GDT_Float32,papszOptions );</div><div>double adfGeoTransform[6] = { static_cast<double>(west), static_cast<double>(OUTPUT_PIXEL_METER), 0.0, static_cast<double>(north), 0.0, static_cast<double>(-OUTPUT_PIXEL_METER) };</div>
<div>OGRSpatialReference oSRS;</div><div>char *pszSRS_WKT = NULL;</div><div>GDALRasterBand *poBand;<br></div><div>rasterData=new float[outWidth*outHeight];<br></div><div>OGRErr err=poDstDS->SetGeoTransform(adfGeoTransform);<br>
</div><div>oSRS.importFromProj4("+proj=merc +ellps=WGS84 +datum=WGS84 +lon_0=0.0 +a=6378137.0 +b=6356752.314 +units=m");<br></div></div><div><br></div><div>Note : The err value is 3 .</div><div>What is wrong with this code ?</div>
<div>thanks</div></div>