On 21/06/08 14:24, Markus Neteler wrote:
On Sat, Jun 21, 2008 at 1:47 PM, Glynn Clements
<[EMAIL PROTECTED]> wrote:
Markus Neteler wrote:

Thanks!  Multiplying by 1000 with r.mapcalc gives better results.  Any
chance adding floating points (FCELL) to i.cluster?
I had a brief look at the code[1], and cannot see any obvious reason
why the values would need to be integers, so I'm assuming that it's
just a legacy of the days before FP support was added.

[1] Most of the code is actually in the lib/imagery/c_*.c files. That
should either be made part of i.cluster (nothing else uses it), or at
least split into a separate library.
I have committed these changes (splitting the cluster code off to a
separate library, and changing it to use DCELL instead of CELL) to the
SVN trunk.

I would appreciate it if someone who understands i.cluster could test
the current version.
(I have backported the changes to 6.4.svn for easier testing for me).

The i.cluster continues to work for CELL maps.

Here a test with the NC data set for FP maps:
Maybe my example is nonsense?
Well, I don't actually understand what i.cluster does, so I couldn't
tell "sensible" output from garbage.

It does something like this:
http://en.wikipedia.org/wiki/Cluster_analysis

More precisely it does a k-means style of cluster analysis, AFAICT. It is used in image classification to reduce the number of elements to class from the total of individual pixels to a more limited number of pixel clusters.


What's needed since we cannot change the format is a normalization
related to the range (AFAIK in i.cluster/print2.c).

After a rapid look: isn't the problem rather in lib/imagery/sig.c, function I_write_signatures, where the fprintf statements use a simple %f ?

Moritz
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to