<div dir="ltr"><div>Dear Nikos, Markus, and Vero,</div><div><br></div><div><br></div><div>Here is a kind of very small routine I have run on the bases of our last chat.</div><div>I guess most of steps are covered, but I still have two questions:</div><div><br></div><div><br></div><div>1. as you can see in the message after running the code the resolution is finally set to 1, but before this message, it still appears "<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">exceeded by 0.999827". </span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The question is: does GRASS prints also the 

<span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"</span><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">exceeded by 0.999827" together with "<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">exceeded by 1 cells</span>"</span> message because one corresponds to the old resolution and the other to the new one, and it is letting know about the change or is because other resason?</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">2. How can I run this same code for many layers instead with one with only one using the command <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">r.in.gdal -a input=PathToMap output=MapName, since r.in.gdal -a takes as input one layer at time?</span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span></div><div>Thanks a lot.</div><div><br></div><div>Best regards,</div><div><br></div><div>Gabriel</div><div><br></div><div><br></div><div>++++++++++++++++++++++++++++++<wbr>++++++++++++++++++++++++++++++<wbr>+++++++++</div><div><br></div><div>Step 1) iport the original raster data layers with the code:</div><div>==============================<wbr>==============================</div><div> </div><div>> r.in.gdal -a input=C:\Users\Gabriel\Documen<wbr>ts\grassdata\light\F121996.tif output=F121996</div><div><br></div><div>360 degree EW extent is exceeded by 0.999827 cells</div><div>360 degree EW extent is exceeded by 0.999827 cells</div><div>360 degree EW extent is exceeded by 0.999827 cells</div><div>360 degree EW extent is exceeded by 1 cells</div><div><br></div><div><br></div><div>

<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> use of </span>r.in.gdal</span> -a helps to adjust resolution for lat long maps fixing the resolution from 0.008333333300000 to 0.008333333333333, i.e. exactly 30 arc-seconds. </div><div><br></div><div><br></div><div>Step 2) show metadate to check:</div><div>==============================</div><div><br></div><div>> <a href="http://r.info" target="_blank">r.info</a> map=F121996 </div><div><br></div><div><br></div><div>360 degree EW extent is exceeded by 1 cells</div><div>360 degree EW extent is exceeded by 0.999827 cells</div><div> +----------------------------<wbr>------------------------------<wbr>------------------+</div><div> | Map:      F121996@PERMANENT              Date: Thu Jul 05 09:19:34 2018    |</div><div> | Mapset:   PERMANENT                      Login of Creator: Gabriel         |</div><div> | Location: lightsLoc1                                                       |</div><div> | DataBase: C:\Users\Gabriel\Documents\gra<wbr>ssdata\light                       |</div><div> | Title:    F121996                                                          |</div><div> | Timestamp: none                                                            |</div><div> |----------------------------<wbr>------------------------------<wbr>------------------|</div><div> |                                                                            |</div><div> |   Type of Map:  raster               Number of Categories: 0               |</div><div> |   Data Type:    CELL                                                       |</div><div> |   Rows:         16801                                                      |</div><div> |   Columns:      43201                                                      |</div><div> |   Total Cells:  725820001                                                  |</div><div> |        Projection: Latitude-Longitude                                      |</div><div> |            N:  75:00:15N    S:  65:00:15S   Res: 0:00:30                   |</div><div> |            E: 180:00:15E    W: 180:00:15W   Res: 0:00:30                   |</div><div> |   Range of data:    min = 0  max = 63                                      |</div><div> |                                                                            |</div><div> |   Data Description:                                                        |</div><div> |    generated by r.in.gdal                                                  |</div><div> |                                                                            |</div><div> |   Comments:                                                                |</div><div> |    r.in.gdal -a input="C:\Users\Gabriel\Docume<wbr>nts\grassdata\light\F1219\   |</div><div> |    96.tif" output="F121996" memory=300 offset=0 num_digits=0               |</div><div> |                                                                            |</div><div> +----------------------------<wbr>------------------------------<wbr>------------------+                                                 </div><div><br></div><div>Step 2: run i.nightlights</div><div>==============================<wbr>==============================<wbr>========</div><div><br></div><div>> i.nightlights.intercalibration image=F121996 suffix=c model=elvidge2014 -t     </div><div> </div><div>|i Inter-satellite calibration of DMSP-OLS Nighttime Stable Lights</div><div>WARNING: Operating on current region</div><div><br></div><div>|> Calibrating average visible Digital Number values</div><div>Regression coefficients: (-0.0959, 1.2727, -0.004) | Associated R^2: 0.9319</div><div>360 degree EW extent is exceeded by 0.999827 cells</div><div>360 degree EW extent is exceeded by 1 cells</div><div><br></div><div><br></div><div>Step 3: seting the region to one of the imported maps with the code:</div><div>==============================<wbr>==============================<wbr>======</div><div><br></div><div>>r.region -a map=F121996</div><div>                                                         </div><div>360 degree EW extent is exceeded by 0.999827 cells</div><div>360 degree EW extent is exceeded by 1 cells</div><div>360 degree EW extent is exceeded by 1 cells</div><div>r.region complete.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 27, 2018 at 4:55 AM, Nikos Alexandris <span dir="ltr"><<a href="mailto:nik@nikosalexandris.net" target="_blank">nik@nikosalexandris.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a><wbr>> [2018-06-26 14:40:25 +0200]:<div><div class="m_-3024801262879882471h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Jun 26, 2018 at 9:53 AM, Nikos Alexandris <<a href="mailto:nik@nikosalexandris.net" target="_blank">nik@nikosalexandris.net</a>><br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
* Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a><wbr>> [2018-06-25 08:29:45 +0200]:<br>
<br>
[..]<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The resolution is a bit wrong, it is 0.008333333300000 but should be<br>
0.008333333333333, i.e. exactly 30 arc-seconds. This can be solved with<br>
</blockquote></blockquote>
the<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-a flag of r.in.gdal, or after import with r.region -a.<br>
<br>
The message<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
360 degree EW extent is exceeded by 0.999827 cells<br>
</blockquote>
<br>
<br>
will change to<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
360 degree EW extent is exceeded by 1 cells<br>
</blockquote>
<br>
<br>
but will not go away, because 360 degree EW extent is exceeded in the<br>
</blockquote></blockquote>
input<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
data, the first and last column cover the same geographical area. You can<br>
change your current region to chop of e.g. the first column: set the<br>
</blockquote></blockquote>
region<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
to the raster, then modify the current region with g.region w=179:59:45W<br>
</blockquote></blockquote>
-p<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and use this region for further processing.<br>
</blockquote></blockquote></blockquote>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I guess this is worth being documented in the manual of the add-on.<br>
</blockquote>
<br>
This is a universal problem applying to various raster data in latlong. The<br>
first issue, 30 sec represented as 0.008333333300000 instead of<br>
0.008333333333333 is solved by r.in.gdal -a. The second problem, this extra<br>
column responsible that 360 degree EW extent is exceeded by 1 cell can be<br>
solved by setting the current region accordingly. This is also a universal<br>
problem. Maybe the manual of r.in.gdal could include a hint about how to do<br>
this. Generally, users are encouraged to inspect the output of <a href="http://r.info" rel="noreferrer" target="_blank">r.info</a> after<br>
importing raster data to check if everything is as expected.<br>
</blockquote>
<br></div></div>
Danke Markus. We should collect some of these hints.<br>
<br>
(<br>
Oh! I took on a refreshing read-tour: a pixel's anchor point, pixel-is-area,<br>
pixel-is-center, center-to-center extent model, precision of pixel size.<br>
Yet, I ended up reading about many more issues that people have to deal<br>
with.<br>
<br>
Some interesting entries:<br>
<br>
- <a href="https://gis.stackexchange.com/q/122670/5256" rel="noreferrer" target="_blank">https://gis.stackexchange.com/<wbr>q/122670/5256</a><br>
- <a href="https://gis.stackexchange.com/a/243050/5256" rel="noreferrer" target="_blank">https://gis.stackexchange.com/<wbr>a/243050/5256</a><br>
)<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Would<br>
it also make sense to let the module attempt to perform this "correction"?<br>
</blockquote>
<br>
If you refer to i.nightlights.intercalibration<wbr>, I would say no, because it<br>
is a more general issue not restricted to DMSP-OLS nightlight data. Even<br>
more general, the current region as set by the user is used for raster<br>
processing (with a very few exceptions).<br>
</blockquote>
<br></span>
Yes, I refer to it. Understood, I won't touch upon this within the<br>
module.<span class="m_-3024801262879882471HOEnZb"><font color="#888888"><br>
<br>
Nikos<br>
</font></span></blockquote></div><br></div></div>