3

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

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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