[GRASS-user] Location of minimum value in raster

Saber Razmjooei razmjooeis at faunalia.co.uk
Wed Aug 3 09:20:42 EDT 2011


First make a 2nd copy of your raster
r.info to get the value of minimum.
r.null to null out all the values more than "minValue + 0.01" (depends on
the decimal values in your raster) through to maxValue.

Cheers
Saber

> Hi,
>
> 2011/8/3 Hamish <hamish_b at yahoo.com>:
>> Joshua wrote:
> [snip]
>> two steps,
>> eval `r.info -r data_map` to get min=
>> r.mapcalc "binary_map = if(data_map == $min, 1, 0)"
>>
>> or perhaps min from 'r.info -r' and coord(s) from grep'ing
>> output of 'r.stats -1g'.
>>
>> perhaps you need to do "abs(data_map - $min) < 0.0000001" for
>> the equivalence test in r.mapcalc, or some similar awk test
>> from the printf() formatted output of r.stats.
>>
>> perhaps you need to do r.buffer from the binary map to make the
>> single pixel(s) easier to locate.
>>
>> d.rast with the cat or value list option might quickly do it too,
>> but a single cell might not visibly render.
>
> Maybe you can convert the resulting raster map into vector points for
> visualization and further processing?
>
> Soeren
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>




More information about the grass-user mailing list