Re: [GRASS-user] integer and discrete raster

2018-09-25 Thread Frank David


Le 9/25/18 à 4:10 PM, Moritz Lennert a écrit :

On 25/09/18 15:40, Frank David wrote:

Thank you Vero,

If I well understand, r.series return always floating values. But 
from trunk r73206 we expect something different... Ok I will wait for 
the next release, and continue with a int().


But I still not understand from where r.series return such values 
(more or less 0.03) from integer... it's mysterious!


It creates bins that correspond to the data. So for value 1 it creates 
a bin 0.972549-1.003922, etc.


You can try r.describe -i to get integer output.

Moritz


Thank you Mortiz,

but why not 0.5-1.5 or 0.9-1.1, I don't understand the reason of that 
precise floating value... but it's not that important.


Frank

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] integer and discrete raster

2018-09-25 Thread Moritz Lennert

On 25/09/18 15:40, Frank David wrote:

Thank you Vero,

If I well understand, r.series return always floating values. But from 
trunk r73206 we expect something different... Ok I will wait for the 
next release, and continue with a int().


But I still not understand from where r.series return such values (more 
or less 0.03) from integer... it's mysterious!


It creates bins that correspond to the data. So for value 1 it creates a 
bin 0.972549-1.003922, etc.


You can try r.describe -i to get integer output.

Moritz

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] integer and discrete raster

2018-09-25 Thread Frank David

Thank you Vero,

If I well understand, r.series return always floating values. But from 
trunk r73206 we expect something different... Ok I will wait for the 
next release, and continue with a int().


But I still not understand from where r.series return such values (more 
or less 0.03) from integer... it's mysterious!


Frank

Le 9/25/18 à 2:43 PM, Veronica Andreo a écrit :

Hello Frank,

See this related thread: 
https://lists.osgeo.org/pipermail/grass-dev/2018-August/089410.html


The method sum in r.series always returns DCELL. But maybe this is 
also a case in which a check of data type could be done beforehand, so 
the result keeps the original data type.


HTH,
Vero



El mar., 25 sept. 2018 a las 10:51, Frank David 
(mailto:frank.da...@geophom.fr>>) escribió:


Hello all,

I've done a sum with r.series from 8 rasters previously calculated
with r.mapcalc. Each raster cell content is 0 or 1. So the sum
raster cells should have 0 to 8. I was looking at r.category to
set labels like "1 to 2", "3 to 4", etc. To see my raster values,
I've done a r.describe, and the result surprised me :

0.00-0.031373
0.972549-1.003922
1.976471-2.007843
2.980392-3.011765
3.984314-4.015686
4.956863-4.988235
5.960784-5.992157
6.964706-6.996078
7.968627-8.00

instead of :

0
1-1
2-2
...
8-8

If I do int(value) with r.mapcalc in my first raster (value is
integer), r.describe returns integer result as expected.

Why r.describe return float values ? how they are calculated ? why
I must make a int() on a integer to get an integer ?

Since my values are integer, how can I force raster in CELL
instead of DCELL ?

Thanks to help me to understand this !

Regards,

Frank

___
grass-user mailing list
grass-user@lists.osgeo.org 
https://lists.osgeo.org/mailman/listinfo/grass-user

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] integer and discrete raster

2018-09-25 Thread Veronica Andreo
Hello Frank,

See this related thread:
https://lists.osgeo.org/pipermail/grass-dev/2018-August/089410.html

The method sum in r.series always returns DCELL. But maybe this is also a
case in which a check of data type could be done beforehand, so the result
keeps the original data type.

HTH,
Vero



El mar., 25 sept. 2018 a las 10:51, Frank David ()
escribió:

> Hello all,
>
> I've done a sum with r.series from 8 rasters previously calculated with
> r.mapcalc. Each raster cell content is 0 or 1. So the sum raster cells
> should have 0 to 8. I was looking at r.category to set labels like "1 to
> 2", "3 to 4", etc. To see my raster values, I've done a r.describe, and the
> result surprised me :
>
> 0.00-0.031373
> 0.972549-1.003922
> 1.976471-2.007843
> 2.980392-3.011765
> 3.984314-4.015686
> 4.956863-4.988235
> 5.960784-5.992157
> 6.964706-6.996078
> 7.968627-8.00
>
> instead of :
>
> 0
> 1-1
> 2-2
> ...
> 8-8
>
> If I do int(value) with r.mapcalc in my first raster (value is integer),
> r.describe returns integer result as expected.
>
> Why r.describe return float values ? how they are calculated ? why I must
> make a int() on a integer to get an integer ?
>
> Since my values are integer, how can I force raster in CELL instead of
> DCELL ?
>
> Thanks to help me to understand this !
>
> Regards,
>
> Frank
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user