<div dir="auto"><div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, 4 Oct 2025, 2:00 am AF via gdal-dev, <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
A PyQGIS code needs to reproject one raster layer from a CRS to a new <br>
one. To begin with, I've tried to use only the minimal required options <br>
so the snippet reads:<br>
             parameters = {<br>
                 'INPUT': my_input_vector_layer,<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Not sure if this is a typo (or a badly named variable, or ai slop code), but it looks like you're trying to warp a vector later to a raster layer? 🤔</div><div dir="auto"><br></div><div dir="auto">Nyall</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                 'SOURCE_CRS': QgsCoordinateReferenceSystem(source_PROJ),<br>
                 'TARGET_CRS': QgsCoordinateReferenceSystem(target_PROJ),<br>
                 'RESAMPLING': 1,<br>
                 'DATA_TYPE': 4,<br>
                 'OUTPUT': '/home/ubuntu/my_new_raster.tif'<br>
                 }<br>
             terrain = processing.run('gdal:warpreproject', parameters)<br>
However, this doesn't do much as terrain is simply a dictionary with the <br>
keyword 'OUTPUT' and my_new_raster.tif is never created. Obviously I <br>
must be doing something wrong and suspect that might be related to <br>
'OUTPUT'. The documentation at <br>
<a href="https://docs.qgis.org/testing/en/docs/user_manual/processing/toolbox.html#output-parameter-widget" rel="noreferrer noreferrer" target="_blank">https://docs.qgis.org/testing/en/docs/user_manual/processing/toolbox.html#output-parameter-widget</a> <br>
didn't dissipate my doubts so I'm unsure how to proceed.<br>
I also tried (an alternative method) calling gdal.Warp directly (not <br>
sure if this method is preferable to using processing.run) but it keeps <br>
saying that it only takes 2 arguments. I found a few examples online but <br>
they all have more than 2 arguments. For example<br>
             options = gdal.WarpOptions(dstSRS=target_PROJ)<br>
             warp = gdal.Warp('/home/ubuntu/pepe.tif', <br>
my_input_vector_layer, options)<br>
             warp = None<br>
complains about including 3 and not 2 arguments. Same if I try including <br>
all arguments at warp.<br>
Thanks.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" rel="noreferrer">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div></div></div>