* Rich Shepard <[email protected]> [2018-01-26 11:12:14 -0800]:

On Fri, 26 Jan 2018, Nikos Alexandris wrote:

how can we compute the median of a floating point cover raster map, over a
base map (using the conventional terminology as in r.stats.zonal)?

Nikos,

 By definition the median value has as many observations/measurements less
than this value as greater than this value. Because floating point numbers
are not represented exactly in computers (unless you extend them out to
several dozen digits to the right of the decimal point), I suggest you
create a map with integer values that will work for your application.

Something like multiply by * 1000, find the median, then divide by 1000
(as suggested in the past for other modules that don't treat fp
numbers).


 You can find cells with values greater than some number, and less than
some number but you'll have a difficult time finding that number and getting
grass (or any application) to recognize it.

HTH,

Yes it helps.

As for the last comment: do you mean it's going to be computationally
"difficult", as in running time?  There are algorithms that handle
this as I read on the net.  If floating point numbers of the cover map
that fall inside an area (as per the base map), are treated as a vector,
then sorting the figures will give an answer.  Even in case of even
number of numbers, the median can be, practically, the average of the
two middle-placed figures, or select the highest number of the lower
part.

Thank you, Nikos

Attachment: signature.asc
Description: PGP signature

_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to