<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NO-BOK" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">GRASS adjusts the resolution to the bounds (extent) you specified, either as n, s, e, w coordinates (like in Processing)
 or using the “vector” or “raster” option. This can conflicting with information provided through the user specified resolution; meaning that either bounds or resolution has to be adjusted. By default priority is given to the bounds (and resolution is adjusted
 if necessary) in GRASS, while setting the a-flag gives priority to the resolution (and bounds are adjusted).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">However, if one wants to align the cells with a specific raster map, the “align” option should be used where only the
 resolution and placement of the cells (not the extent) is picked from the provided raster map. See: https://grass.osgeo.org/grass70/manuals/g.region.html<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Personally, I would say the “align” option (e.g. as “align to input”) is more suitable for modules like r.aspect (and
 the resolution option could be removed) ...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Specifying a resolution can make sense for modules like v.to.rast. However also here alignment with a specific raster
 (e.g. a DEM might be even more desirable).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">There was another thing in Grass7Algorithm.py that surprised me: The use of r.out.gdal.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Using r.external.out befor running the algorithm, should be able to save you one read- and write step:
<a href="https://grass.osgeo.org/grass70/manuals/r.external.out.html">https://grass.osgeo.org/grass70/manuals/r.external.out.html</a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Was it not applicable in Processing?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Stefan
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Pedro Venâncio [mailto:pedrongvenancio@gmail.com]
<br>
<b>Sent:</b> 13. mars 2016 17:47<br>
<b>To:</b> Blumentrath, Stefan <Stefan.Blumentrath@nina.no><br>
<b>Cc:</b> gene <martin.laloux@gmail.com>; qgis-developer@lists.osgeo.org<br>
<b>Subject:</b> Re: [Qgis-developer] Problem with GRASS Region Extent and Region Cellsize on Processing<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Martin and Stefan,<br>
<br>
I understand, if we do not use the -a flag, we can not ensure that the resolution is the set.<br>
<br>
What if there is another option, "align=", as Stefan suggested, which allows to choose a raster from the canvas? This would ensure that the region would be aligned with a selected raster?<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Thank you very much!<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Pedro<br>
<br>
<br>
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2016-03-12 10:44 GMT+00:00 Blumentrath, Stefan <<a href="mailto:Stefan.Blumentrath@nina.no" target="_blank">Stefan.Blumentrath@nina.no</a>>:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><br>
________________________________________<br>
Von: Qgis-developer [<a href="mailto:qgis-developer-bounces@lists.osgeo.org">qgis-developer-bounces@lists.osgeo.org</a>] im Auftrag von gene [<a href="mailto:martin.laloux@gmail.com">martin.laloux@gmail.com</a>]<br>
Gesendet: Samstag, 12. März 2016 10:46<br>
An: <a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a><br>
Betreff: Re: [Qgis-developer] Problem with GRASS Region Extent and Region Cellsize on Processing<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
To keep the raster resolution.<br>
<br>
In the book "OPEN SOURCE GIS A GRASS GIS Approach Third Edition",   p.57<br>
<br>
"It may happen, that region boundaries lead to a modified, non-integer<br>
raster resolution. If this is not desired, the -a flag can be used to align<br>
the region to resolution. It adjusts all four boundaries to be even<br>
multiples of the resolution by slightly enlarging the current region. To see<br>
the effect, compare:<br>
g.region res=15 -dp<br>
g.region res=15 -adp"<br>
<br>
Look also:<br>
<br>
-  suggestion for g.region -a<br>
<<a href="http://osgeo-org.1560.x6.nabble.com/suggestion-for-g-region-a-td4014517.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/suggestion-for-g-region-a-td4014517.html</a>><br>
(Michael Barton)<br>
<br>
"Currently, if you use the -a flag with g.region it will align the region<br>
exactly to match the resolution of a map (e.g. g.region -a rast=myrast will<br>
set the region to exactly the resolution of myrast regardless of the<br>
extents) or the resolution specified in the res or ewres/nwres fields (e.g.<br>
g.region -a n=523 s=15 res=10 will adjust the extents a little to make sure<br>
the resolution is exactly 10)"<br>
<br>
- or in  proposal: make -a flag the default behaviour for g.region<br>
<<a href="https://trac.osgeo.org/grass/ticket/1745" target="_blank">https://trac.osgeo.org/grass/ticket/1745</a>>  (Moritz Lennert)<br>
<br>
"In my experience, when working with raster, having a precise resolution is<br>
the most important issue, while exact extension is less important. I often<br>
use existing vector data or bounds coordinates to determine the extent, but<br>
then have to use the -a flag to make sure that the desired resolution is<br>
kept.<br>
I would like to propose that in grass7, the behaviour is switched, i.e. to<br>
make the -a flag (Align region to resolution) the default behaviour, and<br>
"align to bounds" the option"<br>
<br>
<br>
<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">I guess it depends a bit what the most suitable solution is... There is also the "align" option which aligns the resolution to an input raster. Personally, i only use tha a-flag only in combination with the res option...<br>
Cheers,<br>
Stefan<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Problem-with-GRASS-Region-Extent-and-Region-Cellsize-on-Processing-tp5255693p5255960.html" target="_blank">
http://osgeo-org.1560.x6.nabble.com/Problem-with-GRASS-Region-Extent-and-Region-Cellsize-on-Processing-tp5255693p5255960.html</a><br>
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>