<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hello,</p>
<p style="margin-top:0;margin-bottom:0">I was doing some point rasterization of vector data from postgis database by using gdal_rasterize from a bash script, the command looks like this:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span>gdal_rasterize -a value -b $COUNT -tr $RESOLUTION -te $BBOX -a_nodata $NODATA -a_srs $EPSG PG:'host=localhost dbname=databio user=postgres password=postgres' -sql "SELECT ST_Centroid(g.geom), AVG($COLUMN) as value
FROM $GRID g, $OBSERVACION o WHERE utc_date='$DATE' AND vessel_cfr='$VESSEL' AND ST_Intersects(o.geom,g.geom) IS TRUE GROUP BY g.gid" ./bands/$DATE2"_"$COLUMN".tif"</span><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>The problem is that I want to generate a geotif file with multiple bands, so if I remove the -b $COUNT parameter and value it works and I get a .tif file with the -a value printed on it for band1, but the idea is
to reuse that command in a for loop to add further bands and I am gettin this error:</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span></p>
<div>-b option cannot be used when creating a GDAL dataset.</div>
<div><br>
</div>
I tried to run the comand once to create the tif file without the -b option and then run it additional times with the -b option when the tif is already created but it makes no difference.</span>
<p></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>I am stucked with this and I am starting to think that -b option can only be used with -burn parmeter and as far as I know -burn is only for constant values...</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>thank you in advance for any help.</span></p>
<p style="margin-top:0;margin-bottom:0"><span>cheers,</span></p>
<p style="margin-top:0;margin-bottom:0"><span>Mario</span></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it.
<br>
As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free
and will not be liable for any damages resulting from any virus transmitted. <br>
<br>
Este mensaje y los ficheros adjuntos pueden contener información confidencial destinada solamente a la(s) persona(s) mencionadas anteriormente y pueden estar protegidos por secreto profesional.
<br>
Si usted recibe este correo electrónico por error, gracias por informar inmediatamente al remitente y destruir el mensaje.
<br>
Al no estar asegurada la integridad de este mensaje sobre la red, Atos no se hace responsable por su contenido. Su contenido no constituye ningún compromiso para el grupo Atos, salvo ratificación escrita por ambas partes.
<br>
Aunque se esfuerza al máximo por mantener su red libre de virus, el emisor no puede garantizar nada al respecto y no será responsable de cualesquiera daños que puedan resultar de una transmisión de virus.
</body>
</html>