<div dir="ltr"><div><div><div><div>Hi Martin,<br><br></div>Thank you very much for the hint.<br><br></div>So, runing an operation and aligning the result to a raster with a smaller extent:<br><br>g.proj -c proj4="+proj=tmerc +lat_0=39.66825833333333 +lon_0=-8.133108333333334 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"<br>r.external input="/home/pedro/SIG/MDT_JAG/dem_80m.tif" band=1 output=tmp1457733840723 --overwrite -o<br>g.region -a n=137550.0 s=112250.0 e=100125.0 w=74200.0 res=25<br>r.relief input=tmp1457733840723 altitude="30" azimuth="270" zscale="1" scale="1" output=outputcb4f43647d7f428091f6b2971f87b214 --overwrite<br>g.region raster=outputcb4f43647d7f428091f6b2971f87b214<br>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=outputcb4f43647d7f428091f6b2971f87b214 output="/tmp/processing72b78383106b4767bf4af0e1b207fc0a/fd0523aeda4f47ef87e79b1ea6afe0ae/output.tif"<br><br></div>and the result is ok.<br><br>Running the same operation, but aligning to a raster with a greater extent, and a lower resolution:<br><br>g.proj -c proj4="+proj=tmerc +lat_0=39.66825833333333 +lon_0=-8.133108333333334 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"<br>r.external input="/home/pedro/SIG/MDT_JAG/raster_1.tif" band=1 output=tmp1457734497734 --overwrite -o<br>g.region -a n=154440.0 s=92680.0 e=114680.0 w=64040.0 res=80<br>r.relief input=tmp1457734497734 altitude="30" azimuth="270" zscale="1" scale="1" output=outpute2696cc0c7194a6f80fb2494dd0a97ff --overwrite<br>g.region raster=outpute2696cc0c7194a6f80fb2494dd0a97ff<br>r.out.gdal --overwrite -c createopt="TFW=YES,COMPRESS=LZW" input=outpute2696cc0c7194a6f80fb2494dd0a97ff output="/tmp/processing72b78383106b4767bf4af0e1b207fc0a/02a931bb96124de49723ceacb4e18c46/output.tif"<br><br></div>the extent of the result raster is: w=64000.0 e=114720.0 s=92640.0 n=154480.0<br><div><div><div><div><div>The difference is 40 (half size of the original raster resolution).<br><br><br>So I suspected of the -a flag of g.region <br><br>"""<br>-a: Align region to resolution (default = align to bounds, works only for 2D resolution)<br><br>After all updates have been applied, the current region's southern and western boundaries are (silently) adjusted so that the north/south distance is a multiple of the north/south resolution and that the east/west distance is a multiple of the east/west resolution.<br>With the -a flag all four boundaries are adjusted to be even multiples of the resolution, aligning the region to the resolution supplied by the user. The default is to align the region resolution to match the region boundaries. <br>"""<br></div><div>from <a href="https://grass.osgeo.org/grass70/manuals/g.region.html">https://grass.osgeo.org/grass70/manuals/g.region.html</a> <br><br></div><div>I removed GRASS_REGION_ALIGN_TO_RESOLUTION (-a) from ../python/plugins/processing/algs/grass7/Grass7Algorithm.py and the result was correct <br><br>g.proj -c proj4="+proj=tmerc +lat_0=39.66825833333333 +lon_0=-8.133108333333334 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"<br>r.external input="/home/pedro/SIG/MDT_JAG/raster_1.tif" band=1 output=tmp1457735611533 --overwrite -o<br>g.region n=154440.0 s=92680.0 e=114680.0 w=64040.0 res=80<br>r.relief input=tmp1457735611533 altitude="30" azimuth="270" zscale="1" scale="1" output=output4b1c7211268b4cf79133e876ba2cb133 --overwrite<br>g.region raster=output4b1c7211268b4cf79133e876ba2cb133<br>r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW" input=output4b1c7211268b4cf79133e876ba2cb133 output="/tmp/processingeb0423f9b07f4ef899d08e44b22d61bc/4acf63406c634f7297db9e65f4beebeb/output.tif" --overwrite<br><br>The extent of the result raster was: w=64040.0 e=114680.0 s=92680.0 n=154440.0</div><div><br>Is there any reason to use the -a flag in Processing g.region?<br><br></div><div>Thanks!<br><br></div><div>Best regards,<br></div><div>Pedro</div></div></div></div></div></div>