[GRASS-user] Calculating mode value for each polygon

Greetings

I have an image that is divided in several (>300) polygons and, using a data_map raster, I want to calculate the mode value from this image for each polygon. Is it possible? can anyone give me a tip on this?

Thanks

Monica

Greetings

I have an image that is divided in several (>300) polygons and, using a data_map raster, I want to calculate the mode value from this image for each polygon. Is it possible? can anyone give me a tip on this?

Have a look at v.what.rast. That might be what you’re looking for.

···
-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918

I don’t think so… What I want is to calculate the mode (most frequent value) of a raster file for each polygon that this raster covers. What I will have is the most frequent raster value that falls inside each polygon. Is kind of a univariate statistic of a raster for each polygon.

Any ideas?
(thanks Micha for your suggestion)

On Mon, Oct 18, 2010 at 10:19 AM, Micha Silver <micha@arava.co.il> wrote:

On 18/10/2010 10:11, Monica Buescu wrote:

Greetings

I have an image that is divided in several (>300) polygons and, using a data_map raster, I want to calculate the mode value from this image for each polygon. Is it possible? can anyone give me a tip on this?

Have a look at v.what.rast. That might be what you’re looking for.

Thanks

Monica

This mail was received via Mail-SeCure System.


_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918

This should be done by v.rast.stats but, from the manual I don't think
it includes mode...

On Mon, Oct 18, 2010 at 8:32 AM, Monica Buescu
<monicabuescu1985@gmail.com> wrote:

I don't think so.. What I want is to calculate the mode (most frequent
value) of a raster file for each polygon that this raster covers. What I
will have is the most frequent raster value that falls inside each polygon.
Is kind of a univariate statistic of a raster for each polygon.
Any ideas?
(thanks Micha for your suggestion)

On Mon, Oct 18, 2010 at 10:19 AM, Micha Silver <micha@arava.co.il> wrote:

On 18/10/2010 10:11, Monica Buescu wrote:

Greetings
I have an image that is divided in several (>300) polygons and, using a
data_map raster, I want to calculate the mode value from this image for each
polygon. Is it possible? can anyone give me a tip on this?

Have a look at v.what.rast. That might be what you're looking for.

Thanks
Monica
This mail was received via Mail-SeCure System.

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

--
Micha Silver
http://www.surfaces.co.il/
Arava Development Co. +972-52-3665918

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Uhm That is a pittty. Is anyone planning on developing this?

On Mon, Oct 18, 2010 at 12:33 PM, Daniel Victoria <daniel.victoria@gmail.com> wrote:

This should be done by v.rast.stats but, from the manual I don’t think
it includes mode…

On Mon, Oct 18, 2010 at 8:32 AM, Monica Buescu
<monicabuescu1985@gmail.com> wrote:

I don’t think so… What I want is to calculate the mode (most frequent
value) of a raster file for each polygon that this raster covers. What I
will have is the most frequent raster value that falls inside each polygon.
Is kind of a univariate statistic of a raster for each polygon.
Any ideas?
(thanks Micha for your suggestion)

On Mon, Oct 18, 2010 at 10:19 AM, Micha Silver <micha@arava.co.il> wrote:

On 18/10/2010 10:11, Monica Buescu wrote:

Greetings
I have an image that is divided in several (>300) polygons and, using a
data_map raster, I want to calculate the mode value from this image for each
polygon. Is it possible? can anyone give me a tip on this?

Have a look at v.what.rast. That might be what you’re looking for.

Thanks
Monica
This mail was received via Mail-SeCure System.


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.


Micha Silver
http://www.surfaces.co.il/
Arava Development Co. +972-52-3665918


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

About the sugfgestion from Luisa, of using r.mode it seems exacly what I want… But instead of using polygons I use a raster (coverage map). For me, its ok

I have tested and, I’m obtaining a bit weird error on this:

r.mode base=v0@PERMANENT cover=11073_B@PERMANENT output=test_outputv0

ERROR: reading r.stats output
ERROR: No rules specified

My 11073_B is a CELL satellite image (0-1000)
my v0 is a FCELL raster with values that range from 1 til 50000 (but I don’t have that many values only 30 of them but are dispersed between 1 and 50000.

Any ideas to fix this?
THanks
Monica

On Mon, Oct 18, 2010 at 12:33 PM, Daniel Victoria <daniel.victoria@gmail.com> wrote:

This should be done by v.rast.stats but, from the manual I don’t think
it includes mode…

On Mon, Oct 18, 2010 at 8:32 AM, Monica Buescu
<monicabuescu1985@gmail.com> wrote:

I don’t think so… What I want is to calculate the mode (most frequent
value) of a raster file for each polygon that this raster covers. What I
will have is the most frequent raster value that falls inside each polygon.
Is kind of a univariate statistic of a raster for each polygon.
Any ideas?
(thanks Micha for your suggestion)

On Mon, Oct 18, 2010 at 10:19 AM, Micha Silver <micha@arava.co.il> wrote:

On 18/10/2010 10:11, Monica Buescu wrote:

Greetings
I have an image that is divided in several (>300) polygons and, using a
data_map raster, I want to calculate the mode value from this image for each
polygon. Is it possible? can anyone give me a tip on this?

Have a look at v.what.rast. That might be what you’re looking for.

Thanks
Monica
This mail was received via Mail-SeCure System.


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.


Micha Silver
http://www.surfaces.co.il/
Arava Development Co. +972-52-3665918


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user