[GRASS-dev] Re: r.series: threshold/count method?

Markus Neteler neteler at osgeo.org
Fri Sep 4 18:24:15 EDT 2009


On Thu, Sep 3, 2009 at 11:47 PM, Markus Neteler<neteler.osgeo at gmail.com> wrote:
> Glynn Clements wrote:
>> Markus Neteler wrote:
>>
>> In 7.0, the prototype for aggregates has recently been changed to
>> accept an additional parameter of type "const void *". r.series uses
>> this to implement the quantile= option for method=quantile.
>>
>
> Ah, thanks - I didn't realize the difference. This will help.

It does.

Since I eventually need it in (locally) 6.4, I have backported
"arbitrary quantiles" from trunk.

I have now added the new threshold method (locally):

   quantile   Quantile to calculate for method=quantile
              options: 0.0-1.0
  threshold   Threshold to calculate for method=threshold

but need to pass the value to the function. This happens for quantile here
in main.c from r.series:

   240                  if (null && flag.nulls->answer)
   241                      G_set_d_null_value(&out->buf[col], 1);
   242                  else {
   243                      memcpy(values_tmp, values, num_inputs *
sizeof(DCELL));
   244                      (*out->method_fn)(&out->buf[col],
values_tmp, num_inputs, &out->quantile);
   245                  }

Since I am getting lost in the pointers, how to pass '&out->threshold'
instead of
&out->quantile when I use the threshold method? I guess I don't want to add
more parameters to line 244...

Some condition upon presence of quantile/threshold is IMHO needed...

Markus


More information about the grass-dev mailing list