<div dir="ltr"><div dir="ltr"><div>prem ise: I never used this class (btw it should be necessary to create a processing alg to use it to remove some gdal calc limitations)</div>I can't say if there is some error in SIP definition or whatelse... but I suggest to check the use of the class directly in it's testsĀ <a href="https://github.com/qgis/QGIS/blob/master/tests/src/analysis/testqgsalignraster.cpp">https://github.com/qgis/QGIS/blob/master/tests/src/analysis/testqgsalignraster.cpp</a> and if there is a lack of test, please add it in cpp or python.</div><div dir="ltr"><br></div><div dir="ltr">I hope this can help you</div><div dir="ltr"><div><br clear="all"><div><div dir="ltr" class="gmail_signature">Luigi Pirelli<br><br>**************************************************************************************************<br>* LinkedIn: <a href="https://www.linkedin.com/in/luigipirelli" target="_blank">https://www.linkedin.com/in/luigipirelli</a><br>* Stackexchange: <a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" target="_blank">http://gis.stackexchange.com/users/19667/luigi-pirelli</a><br>* GitHub: <a href="https://github.com/luipir" target="_blank">https://github.com/luipir</a><br>* Mastering QGIS 2nd Edition:<br>* <a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition" target="_blank">https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition</a><br>* Hire me: <a href="http://goo.gl/BYRQKg" target="_blank">http://goo.gl/BYRQKg</a><br>**************************************************************************************************</div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, 29 Sep 2018 at 01:24, Xristos Xristoou <<a href="mailto:saxri89@gmail.com">saxri89@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">hello<div><br></div><div><span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;background-color:rgba(248,248,248,0.6)">I am trying to align rasters in pyqgis or python and i find this postĀ </span><br></div><div><span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px;background-color:rgba(248,248,248,0.6)"><br></span></div><div><span style="background-color:rgba(248,248,248,0.6)"><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"><a href="https://gis.stackexchange.com/questions/297216/qgsalignraster-extent" target="_blank">https://gis.stackexchange.com/questions/297216/qgsalignraster-extent</a></span></font><br></span></div><div><span style="background-color:rgba(248,248,248,0.6)"><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"><br></span></font></span></div><div><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px;background-color:rgba(248,248,248,0.6)">where is that i need ,but because i am in the first steps can someone to help me about how t define input parameters and how to fix extend problem ?</span></font></div><div><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px;background-color:rgba(248,248,248,0.6)"><br></span></font></div><div><br></div><div><pre style="color:rgb(0,0,0);font-family:"Courier New""><br><span style="color:rgb(0,0,128);font-weight:bold">def </span>alignRaster(raster, raster_to_align, output, proj, cell_size):<br> alignClass = QgsAlignRaster()<br> item1 = QgsAlignRaster.Item(raster, <span style="color:rgb(0,128,0);font-weight:bold">""</span>)<br> item2 = QgsAlignRaster.Item(raster_to_align, output)<br><br> alignClass.setRasters([item1, item2])<br> alignClass.setParametersFromRaster(raster, proj)<br> alignClass.setCellSize(cell_size,cell_size)<br> alignClass.checkInputParameters()<br> alignClass.createAndWarp(item2)<br> rLyr = QgsRasterLayer(raster)<br> clipExtent = rLyr.extent()<br> alignClass.setClipExtent(clipExtent)<br><br>raster=<span style="color:rgb(0,128,0);font-weight:bold">'rel_dem.tif'<br></span>raster_to_align=<span style="color:rgb(0,128,0);font-weight:bold">'DEM.tif'<br></span>output=<span style="color:rgb(0,128,0);font-weight:bold">'OUT.tif'<br></span>cell_size=<span style="color:rgb(0,0,255)">50<br></span>proj=<span style="color:rgb(0,128,0);font-weight:bold">'26986'<br></span>alignRaster(raster, raster_to_align, output, proj, cell_size)</pre><pre style="color:rgb(0,0,0);font-family:"Courier New""><br></pre><pre style="color:rgb(0,0,0);font-family:"Courier New"">and i take this error :</pre><pre style="color:rgb(0,0,0);font-family:"Courier New""><br></pre><pre><font color="#000000" face="Courier New">ERROR 1: Failed to import coordinate system `'.
ERROR 1: Attempt to create 0x0 dataset is illegal,sizes must be larger than zero.<br></font></pre><pre style="color:rgb(0,0,0);font-family:"Courier New""><br></pre></div></div></div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div>