[Gvsig_english] Raster tool for cell counting

Antonio Falciano afalciano at yahoo.it
Thu Mar 11 18:14:16 CET 2010


Il 11/03/2010 17.09, Nicolas DEVAUX ha scritto:
> Antonio Falciano a écrit :
>> Il 24/02/2010 14.06, Nicolas DEVAUX ha scritto:
>>
>>> Antonio Falciano a écrit :
>>>
>>>> Il 24/02/2010 11.56, Nicolas DEVAUX ha scritto:
>>>>
>>>>
>>>>> gvSIG 1.9 Sextante 0.3-1232 Ubuntu 9.10
>>>>>
>>>>> Hi, I have a bolean reclassified raster layer with 0 and 1 values
>>>>> cells. I'm looking for a tool that count the total number of each
>>>>> value cell in the raster layer. I tried the function Sort with
>>>>> sextante but it didn't work... Do i need a specific raster format for
>>>>> doing this ?
>>>>>
>>>>> Does anybody have an idea ?
>>>>>
>>>>>
>>>> Hi Nicolas,
>>>> you can use the histogram tool in gvSIG [1] on your before reclassified
>>>> raster layer, without the need to change its format. Hope this helps!
>>>>
>>>> Cheers,
>>>> Antonio
>>>>
>>>> [1]
>>>> https://gvsig.org/web/docusr/new-functionalities-gvsig-1-9/raster/funcionalidades-de-capa/histograma/descripcion
>>>>
>>>>
>>>>
>>> I already tried this solution.
>>> It can work with very few values raster layer, but how do you do if you
>>> have 20 or 30 different values ?
>>> I tried to export the statistics, but the resulting table gave me the
>>> rank order of the different cells values and not the exact cell value
>>> that I have in each cell...
>>> I would like to have something like in other GIS softwares that can
>>> count all pixels associate with such or such other values...
>>>
>>
>> Nico,
>> have you already tried "Class statistics" tool available into "Raster
>> categories
>> analysis" group in SEXTANTE?
>>
>> Cheers,
>> Antonio
>>
>>
> Hi Antonio, I was a little bit busy last days, but I tried Class
> statistics. Sometimes it works, but not always... It doesn't work on a
> short integer raster with bolean values (0 or 1)...

Hi Nicolas,
it should work with binary raster too...

> It works with a short integer normal DTM raster layer...
> But, the result is very strange. If you open the dbf file which is
> created, you can't do anything with normal table tools... You can't
> make a hierarchical sort, You can't make a simple query... Like if the
> table content was not understood by GvSIG. But, if I add a new field
> egal to another field created by the class stats function, it works...
> That's really strange.

It's not strange... it only depends by the field names which contain
spaces and so the filter function doesn't recognize them... this bug has
to be fixed. Can you open a ticket on Sextante bug tracker [1]?

> the main problem is that ID field is not sorted and you can't do any
> query on it because it is not working. So If you want to know how many
> pixels have the value of 52 for example, you have to find this value by
> your own in the table...

You have simply to rename all fields without space and then you can do
everything with class statistics table.

Cheers,
Antonio

[1] http://forge.osor.eu/tracker/?func=browse&group_id=13&atid=372

-- 
Antonio Falciano
http://www.linkedin.com/in/antoniofalciano


More information about the Gvsig_internacional mailing list