Hello,
I think it is a very simple problem but I don't get it.
I have a raster which I want to convert to integer but doing so results in
areas with null() values.
When I look at the input raster (r.what) I get areas which look like this:
-1.59582443346|6.02450629749||927119811.912364006|
which also look fine in the integer conversion, but other areas give following
r.what infos:
-2.14304204004|6.63535385832||2633784216.1745109558|no data
these areas results in null() values after integer conversion.
I tried to remove the |no data part with the @rastername in r.mapcalc but that
does not work, because only the second part is taken.
Any ideas how to remove the |no data part?
TIA, Martin
Martin Wegmann wrote:
I think it is a very simple problem but I don't get it.
I have a raster which I want to convert to integer but doing so results in
areas with null() values.
When I look at the input raster (r.what) I get areas which look like this:
-1.59582443346|6.02450629749||927119811.912364006|
which also look fine in the integer conversion, but other areas give following
r.what infos:
-2.14304204004|6.63535385832||2633784216.1745109558|no data
these areas results in null() values after integer conversion.
Note that 2633784216 is too large to be represented as an integer; the
range of integers is -2147483647 to +2147483647 inclusive.
If you have values outside that range, you will need to rescale.
--
Glynn Clements <glynn@gclements.plus.com>
On Wednesday 02 May 2007 15:58, Glynn Clements wrote:
Martin Wegmann wrote:
> I think it is a very simple problem but I don't get it.
>
> I have a raster which I want to convert to integer but doing so results
> in areas with null() values.
> When I look at the input raster (r.what) I get areas which look like
> this:
>
> -1.59582443346|6.02450629749||927119811.912364006|
>
> which also look fine in the integer conversion, but other areas give
> following r.what infos:
>
> -2.14304204004|6.63535385832||2633784216.1745109558|no data
>
> these areas results in null() values after integer conversion.
Note that 2633784216 is too large to be represented as an integer; the
range of integers is -2147483647 to +2147483647 inclusive.
If you have values outside that range, you will need to rescale.
oh, yeah, thanks - I did:
MIN=`r.info -r "$GIS_OPT_input" | grep min | cut -f2 -d=`
MAX=`r.info -r "$GIS_OPT_input" | grep max | cut -f2 -d=`
r.mapcalc "tttemp1 = ( ( $GIS_OPT_input - abs($MIN) ) / (abs($MAX) -
abs($MIN)) ) * ( $GIS_OPT_range_max - $GIS_OPT_range_min) +
$GIS_OPT_range_min"
know it works, thanks!
Martin