<div dir="ltr">Hi Micha<div><br></div><div> Many thanks for your reply. </div><div> Here is the command I am using: </div><div><br></div><div> if(float(cat1_acc_riv) == float(cat1_minacc), str_r, null()) </div><div> </div><div> The str_r is a CELL raster. the result is different when I change it to: </div><div>
if(int(cat1_acc_riv) == int(cat1_minacc), str_r, null())
</div><div> </div><div> Here is output of <a href="http://r.info">r.info</a> for first DCELL raster </div><div><br></div><div>+----------------------------------------------------------------------------+<br> | Map: cat1_acc_riv@PERMANENT Date: Sat Jan 23 22:58:42 2021 |<br> | Mapset: PERMANENT Login of Creator: m43han |<br> | Location: main_working_location |<br> | DataBase: C:\Users\m43han\Documents\Routing_Prod\Prod000001\grassdb |<br> | Title: cat1_acc_riv |<br> | Timestamp: none |<br> |----------------------------------------------------------------------------|<br> | |<br> | Type of Map: raster Number of Categories: 19432056 |<br> | Data Type: DCELL |<br> | Rows: 4239 |<br> | Columns: 9254 |<br> | Total Cells: 39227706 |<br> | Projection: Latitude-Longitude |<br> | N: 50:52:39N S: 40:16:48N Res: 0:00:09 |<br> | E: 70:10:39W W: 93:18:45W Res: 0:00:09 |<br> | Range of data: min = 250752 max = 19432056 |<br> | |<br> | Data Description: |<br> | generated by r.mapcalc |<br> | |<br> | Comments: |<br> | if(isnull(str_r), null(), acc) |<br> | |<br> +----------------------------------------------------------------------------+<br>(Sun Jan 24 04:45:38 2021) Command finished (0 sec) <br></div><div><br></div><div><br></div><div>Here is <a href="http://r.info">r.info</a> output for second raster</div><div> +----------------------------------------------------------------------------+<br> | Map: cat1_minacc@PERMANENT Date: Sat Jan 23 22:58:48 2021 |<br> | Mapset: PERMANENT Login of Creator: m43han |<br> | Location: main_working_location |<br> | DataBase: C:\Users\m43han\Documents\Routing_Prod\Prod000001\grassdb |<br> | Title: cat1_minacc |<br> | Timestamp: none |<br> |----------------------------------------------------------------------------|<br> | |<br> | Type of Map: raster Number of Categories: 0 |<br> | Data Type: FCELL |<br> | Rows: 4239 |<br> | Columns: 9254 |<br> | Total Cells: 39227706 |<br> | Projection: Latitude-Longitude |<br> | N: 50:52:39N S: 40:16:48N Res: 0:00:09 |<br> | E: 70:10:39W W: 93:18:45W Res: 0:00:09 |<br> | Range of data: min = 250752 max = 1.817303e+007 |<br> | |<br> | Data Description: |<br> | generated by r.stats.zonal |<br> | |<br> | Comments: |<br> | r.stats.zonal --overwrite base="str_r" cover="cat1_acc_riv" method="\ |<br> | min" output="cat1_minacc" |<br> | |<br> +----------------------------------------------------------------------------+<br>(Sun Jan 24 04:46:50 2021) Command finished (0 sec) <br></div><div><br></div><div>Thanks</div><div>Ming </div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Micha Silver <<a href="mailto:tsvibar@gmail.com">tsvibar@gmail.com</a>> 于2021年1月24日周日 上午3:29写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Is there some reason that you expect the rasters to be the same? Maybe<br>
begin by posting the outputs of `<a href="http://r.info" rel="noreferrer" target="_blank">r.info</a>` for both rasters, and what<br>
command you used to compare them?<br>
<br>
On Sun, Jan 24, 2021 at 6:13 AM ming han <<a href="mailto:dustming@gmail.com" target="_blank">dustming@gmail.com</a>> wrote:<br>
><br>
> Hi Everyone<br>
><br>
> I tried to compare if grids in two rasters are the same, one raster is FCELL and another raster is DCELL. I got different result when I int both raster first before comparing them; and when I float() both raster first before I comparing them<br>
><br>
> Is there any reason for this?<br>
><br>
> Thanks<br>
> Ming<br>
> _______________________________________________<br>
> grass-user mailing list<br>
> <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
<br>
<br>
<br>
-- <br>
Micha Silver<br>
Ben Gurion Univ<br>
Sde-Boker Remote Sensing Lab<br>
cell: +972 (52) 3665918<br>
</blockquote></div>