7

I am deploying QGIS 3.6 on Windows 10.

Using the Raster > Projections > Warp (Reproject) tool, I need to reproject a single-band, float32, GeoTIFF DEM from EPSG:3413 to EPSG:3857.

The output raster must snap to a pre-existing GeoTIFF, also in EPSG:3857.

PROBLEM: The tool does not include a snapping option. The tool's help page is silent on snapping, as is a Google search.

There is a curious input section entitled "Additional Command Line Parameters". But again, no guidance.

How to include snapping when reprojecting?

Example

3
  • I may be misunderstanding your question but did you try the "Georeferenced extents of the output file to be created (xmin, xmax, ymin, ymax)" option above your highlight with the extent of the layer you want to snap to? You can load the layer you want to snap to and use the dropdown to populate the field. Commented Jun 2, 2021 at 17:32
  • Yes, you are correct, @Jean-FrancoisPrieur! @radouxju mentions that in their answer, but you correctly state how to make use of a snap raster in QGIS. Thanks!
    – Stu Smith
    Commented Jun 2, 2021 at 18:57
  • See gis.stackexchange.com/questions/415860/… for further answers
    – Buff Fox
    Commented Apr 16 at 4:50

2 Answers 2

5

QGIS raster projection directly uses the gdalwarp application. It therefore builds a gdal command based on the form, but launces exactly what is written in the "GDAL/OGR cosole call" box. So, for more information about the additionnal command lines, you should refer to gdalwarp

That being said, there is no direct method to snap a raster with gdalwarp. You must therefore note the extent and the pixel size of your expected extent, and use it in the command line. This can be done with the "output file resolution" (for pixel size) and the "georeferenced extent of the output file to be created" (for extent) boxes, or you can directly write it inside "additionnal command line parameter" in the gdal syntax

-tr your_pixel_size_X your_pixel_size_Y -te your_xmin your_xmax your_ymin your_ymax

Note that you can use python to automate the extent extraction (see e.g. here ). You can also use "Raster/Align raster" after reprojecting, but this will cause a double resampling which, for most resmpling method, is not recommended.

0

Neither QGIS nor GDALWarp support raster snapping. This inherently makes raster operations far more difficult when computing rasters from different sources against each other.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.