<div dir="ltr"><br><br>On Mon, Oct 1, 2018 at 4:28 PM Nikos Alexandris <<a href="mailto:nik@nikosalexandris.net">nik@nikosalexandris.net</a>> wrote:<br>><br>> Nikos wrote:<br>><br>> >> Import using r.in.gdal, _without_ any of `-l` or `-a` and then I get the<br>> >> closest to the reported spatial resolution. Else, with `-a`, for<br>> >> example, the spatial resolution is not as close to the "original" one.<br>> >> Makes sense?<br>><br>> >what would be the output resolution and extends with r.in.gdal -a?<br>> >Generally r.in.gdal -a provides the best results.<br>><br>> Importing with/out `-a` and `-al`:<br>><br>> for MAP in $(g.list raster pattern=import*) ;do echo $MAP && <a href="http://r.info">r.info</a> -g $MAP && echo ;done<br>><br>> import<br>> 360 degree EW extent is exceeded by 0.00019226 cells<br>> north=80.0223214291667<br>> south=-79.9776823855556<br>> east=179.977687153889<br>> west=-180.022321429167<br>> nsres=0.0446428582072328<br>> ewres=0.0446428582072241<br>> rows=3584<br>> cols=8064<br>> cells=28901376<br>> datatype=CELL<br>> ncats=0<br>><br>> import_with_a<br>> north=80.0223333333333<br>> south=-79.9634444444444<br><div><br></div><div>something went wrong here:<br></div><div>> east=179.945666666667</div><div>east should be 180 - ew_res / 2<br></div><div><br></div><div>just like<br></div><div>> west=-180.022333333333</div><div>i.e west = -180 - ew_res / 2</div><div><br></div><div>I will investigate<br></div><br>> nsres=0.0446388888888889<br>> ewres=0.0446388888888889<br>> rows=3584<br>> cols=8064<br>> cells=28901376<br>> datatype=CELL<br>> ncats=0<br>><br>> import_with_al<br>> north=80.0223333333333<br>> south=-79.9634444444444<br>> east=179.968<br>> west=-180<br>> nsres=0.0446388888888889<br>> ewres=0.0446388888888889<br>> rows=3584<br>> cols=8064<br>> cells=28901376<br>> datatype=CELL<br>> ncats=0<br>><br>> The first "import" map's ns/ew resolution is closest to the original.<br>><br>> >><br>> >> Better to cut off the west side (?):<br>> >> ```<br>> >> g.region raster=g2_BIOPAR_LST_201606220100_GLOBE_GEO_V1.2.nc_LST -pag<br>> >w=-180 e=180<br>> ><br>> >this shifts the grid by half a cell to the east. The -a flag does not make<br>> >sense because 1) you want to force new extends, 2) there is no resolution<br>> >given for use with the -a flag.<br>><br>> More precise, this shifts the computational's region grid by half a<br><div>> cell to the east. Right?</div><div><br></div><div>it shifts the raster map to the east, not the computational region.<br></div>><br>> If the default of `-a` is "to align the region resolution to match the<br><div>> region boundaries", <br></div><div><br></div><div>?</div><div>from the manual:</div><div>"With the <b>-a</b> flag all four boundaries are adjusted 
to be even multiples of the resolution, aligning the region to the
resolution supplied by the user."</div><div><br></div><div>i.e. with the -a flag, the region boundaries are modified and the resolution is kept. The default (without -a) is to
align the region resolution to match the region boundaries.

</div><div><br></div><div>> won't the above command try to modify the spatial</div>> resolution, of the computational region, so as to perfectly fit inside<br>> the currently set, of user provided, boundaries?<br>><br>> If, say, the region's boundaries are n=80 s=-80 w=-180 e=180 and the<br>> raster map's rows and columns 3584 and 8064 respectively, won't the<br>> above command try to adjust the region's resolution so as to fit these<br><div>> cells inside these boundaries?</div><div><br></div><div>If you want to "adjust the region's resolution so as to fit these cells inside these boundaries", you must not use the -a flag. <br></div><div><br></div><div>Markus M<br></div></div>