<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
</div>Do you mean QgsRasterInterface with multiple inputs? This is not<br>
currently supported. In theory you can write an interface with<br>
multiple inputs, but for example QgsRasterFileWriter is using some<br>
info from srcInput, i.e. the first interface (provider) in the pipe,<br>
there is no support for multiple srcInput. Most probably it would<br>
work, but there some problems may appear. You could also overwrite<br>
srcInput in your QgsRasterInterface subclass in which multiple<br>
branches are connected.<br></blockquote><div><br></div><div>Ok, but I wonder what is QgsRasterInterface.setInput [1] meant for? Is the input supposed to be only a QgsRasterDataProvider? If I see that it requires a QgsRasterInterface I think it can be whatever else QgsRasterInterface... </div>
<div><br></div><div>[1] <a href="https://github.com/qgis/Quantum-GIS/blob/master/src/core/raster/qgsrasterinterface.h#L108">https://github.com/qgis/Quantum-GIS/blob/master/src/core/raster/qgsrasterinterface.h#L108</a></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Radim<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> giovanni<br>
><br>
><br>
> 2012/12/11 Radim Blazek <<a href="mailto:radim.blazek@gmail.com">radim.blazek@gmail.com</a>><br>
>><br>
>> On Tue, Dec 11, 2012 at 10:52 AM, G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>> wrote:<br>
>> > Until now I've mostly created vector layers on QGIS, delegating raster<br>
>> > creation to custom GDAL utilities.<br>
>> > Recently I looked into QgsGdalProvider and I saw that it exposes the<br>
>> > QgsRasterDataProvider::Create capability.<br>
>> > I wonder if it's possible to create a brand new raster (geotiff or what<br>
>> > else) using this provider and, in case, what is the right workflow to do<br>
>> > that. I haven't found examples of doing it...<br>
>><br>
>> Yes it is possible. You can use a provider directly<br>
>><br>
>> QgsRasterDataProvider * provider = ( QgsRasterDataProvider*<br>
>> )QgsProviderRegistry::instance()->provider( "gdal", dataSource );<br>
>> provider->write( data, band, width, height, xOffset, yOffset )<br>
>><br>
>> if you your algorithm implemented as QgsRasterInterface you can use<br>
>> higher level QgsRasterFileWriter which will do the work splitting<br>
>> raster into parts<br>
>><br>
>> QgsRasterPipe* pipe = new QgsRasterPipe();<br>
>> pipe->set( inputProvider->clone() );<br>
>> pipe->insert( 1, yourInterface );<br>
>> QgsRasterFileWriter fileWriter( fileName );<br>
>> fileWriter.writeRaster( pipe, width, height, extent, crs );<br>
>><br>
>> Radim<br>
>><br>
>><br>
>> > giovanni<br>
>> ><br>
>> > _______________________________________________<br>
>> > Qgis-developer mailing list<br>
>> > <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>> > <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br>