Hi dear all, I need to resample a tree cover map create by Landsat imagery to the MODIS 250 meters. If I use the resample function of raster package, it will compute the value based on bilinear or ngb, in this condition the new class map will not answer my expectations. I loking for a way of resample using the statistical mode to define the value of the pixel of the new map. Some tip about this? Thanks Isaque ------------------------------------------------------------------------------------------------------------------ Agronomist engineer Master in Remote Sensing - National Institute for Space Research (INPE) - Brazil PHD Student in Transport - Bras?lia University (UNB)
How to resample a map using the statistical mode of class to fill the new pixel
7 messages · Isaque Daniel, Bacou, Melanie, Philippi, Tom
Isaque, check this thread on StackExchange: http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work --Mel.
On 8/26/2016 10:07 PM, Isaque Daniel wrote:
Hi dear all, I need to resample a tree cover map create by Landsat imagery to the MODIS 250 meters. If I use the resample function of raster package, it will compute the value based on bilinear or ngb, in this condition the new class map will not answer my expectations. I loking for a way of resample using the statistical mode to define the value of the pixel of the new map. Some tip about this? Thanks Isaque ------------------------------------------------------------------------------------------------------------------ Agronomist engineer Master in Remote Sensing - National Institute for Space Research (INPE) - Brazil PHD Student in Transport - Bras?lia University (UNB) [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Mel's answer is complete if you are aggregating to an integer multiple of grid cells: if your tree cover was 5, 10, 25, 50, 125, etc., m pixels. If you are unlucky enough to have your tree cover in 15 or 30m pixels, you may need to disaggregate to greatest common factor (5 or 10m) cells first, then aggregate up to 250m MODIS. With mode on categorical data, that should still give you your expected results; with continuous raster values and other functions, it might not be appropriate. Tom 2
On Fri, Aug 26, 2016 at 7:28 PM, Bacou, Melanie <mel at mbacou.com> wrote:
Isaque, check this thread on StackExchange: http://gis.stackexchange.com/questions/177423/r-aggregate- raster-with-mode-function-how-does-it-work --Mel. On 8/26/2016 10:07 PM, Isaque Daniel wrote:
Hi dear all, I need to resample a tree cover map create by Landsat imagery to the
MODIS 250 meters.
If I use the resample function of raster package, it will compute the
value based on bilinear or ngb, in this condition the new class map will not answer my expectations.
I loking for a way of resample using the statistical mode to define the
value of the pixel of the new map.
Some tip about this? Thanks Isaque ------------------------------------------------------------
------------------------------------------------------
Agronomist engineer Master in Remote Sensing - National Institute for Space Research (INPE)
- Brazil
PHD Student in Transport - Bras?lia University (UNB)
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Hi Mel!! Thanks for the contribution, but my problem is to do that using the reference grid a MODIS image to compute value of new image using the Modal function. The perfectly solution would be a resample raster function with the mode or modal of values can be used. Best Isaque ------------------------------------------------------------------------------------------------------------------ Eng. Agr. Isaque Daniel Rocha Eberhardt Mestre em Sensoriamento Remoto - Instituto Nacional de Pesquisas Espaciais (INPE) Doutorando em Transportes - Universidade de Bras??lia (UNB) Mobile: +55 (061) 99015658 ------------------------------------------------------------------------------------------------------------------ Agronomist engineer Master in Remote Sensing - National Institute for Space Research (INPE) - Brazil PHD Student in Transport - Bras??lia University (UNB)
De: Bacou, Melanie <mel at mbacou.com>
Enviado: s?bado, 27 de agosto de 2016 02:28 Para: Isaque Daniel; r-sig-geo Assunto: Re: [R-sig-Geo] How to resample a map using the statistical mode of class to fill the new pixel Isaque, check this thread on StackExchange: http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work [http://cdn.sstatic.net/Sites/gis/img/apple-touch-icon at 2.png?v=54e3ab1edcf3&a]<http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work> R: aggregate raster with 'mode' function - how does it ...<http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work> gis.stackexchange.com I want to aggregate a very fine resolution raster at various coarser resolutions (that represents many 1000s of categorical polygons). The aggregate{raster} function ... --Mel. On 8/26/2016 10:07 PM, Isaque Daniel wrote: Hi dear all, I need to resample a tree cover map create by Landsat imagery to the MODIS 250 meters. If I use the resample function of raster package, it will compute the value based on bilinear or ngb, in this condition the new class map will not answer my expectations. I loking for a way of resample using the statistical mode to define the value of the pixel of the new map. Some tip about this? Thanks Isaque ------------------------------------------------------------------------------------------------------------------ Agronomist engineer Master in Remote Sensing - National Institute for Space Research (INPE) - Brazil PHD Student in Transport - Bras?lia University (UNB) [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org<mailto:R-sig-Geo at r-project.org> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Exactly Tom 2!! I'll try your sugestion, but I need to fit the new tree cover map (in 250 meters) with the Modis raster positions. Best Isaque ------------------------------------------------------------------------------------------------------------------ Eng. Agr. Isaque Daniel Rocha Eberhardt Mestre em Sensoriamento Remoto - Instituto Nacional de Pesquisas Espaciais (INPE) Doutorando em Transportes - Universidade de Bras??lia (UNB) Mobile: +55 (061) 99015658 ------------------------------------------------------------------------------------------------------------------ Agronomist engineer Master in Remote Sensing - National Institute for Space Research (INPE) - Brazil PHD Student in Transport - Bras??lia University (UNB)
De: Tom Philippi <tephilippi at gmail.com>
Enviado: s?bado, 27 de agosto de 2016 02:43 Para: Bacou, Melanie Cc: Isaque Daniel; r-sig-geo Assunto: Re: [R-sig-Geo] How to resample a map using the statistical mode of class to fill the new pixel Mel's answer is complete if you are aggregating to an integer multiple of grid cells: if your tree cover was 5, 10, 25, 50, 125, etc., m pixels. If you are unlucky enough to have your tree cover in 15 or 30m pixels, you may need to disaggregate to greatest common factor (5 or 10m) cells first, then aggregate up to 250m MODIS. With mode on categorical data, that should still give you your expected results; with continuous raster values and other functions, it might not be appropriate. Tom 2 On Fri, Aug 26, 2016 at 7:28 PM, Bacou, Melanie <mel at mbacou.com<mailto:mel at mbacou.com>> wrote: Isaque, check this thread on StackExchange: http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work --Mel. On 8/26/2016 10:07 PM, Isaque Daniel wrote: > Hi dear all, > > > I need to resample a tree cover map create by Landsat imagery to the MODIS 250 meters. > > If I use the resample function of raster package, it will compute the value based on bilinear or ngb, in this condition the new class map will not answer my expectations. > > > I loking for a way of resample using the statistical mode to define the value of the pixel of the new map. > > > Some tip about this? > > Thanks > Isaque > > > > ------------------------------------------------------------------------------------------------------------------ > Agronomist engineer > Master in Remote Sensing - National Institute for Space Research (INPE) - Brazil > PHD Student in Transport - Bras?lia University (UNB) > > [[alternative HTML version deleted]] > > > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo at r-project.org<mailto:R-sig-Geo at r-project.org> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org<mailto:R-sig-Geo at r-project.org> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
1 day later
Isaque, If your LandScan raster is at 30m resolution, then best might be to `aggregate()` to as close as 250m (e.g. using `fact=8` or `fact=9` and `fun=modal`), and then use `projectRaster()`: projectRaster(from, to, method="bilinear") Others might have better ideas. --Mel.
On 8/26/2016 10:43 PM, Tom Philippi wrote:
Mel's answer is complete if you are aggregating to an integer multiple
of grid cells: if your tree cover was 5, 10, 25, 50, 125, etc., m
pixels. If you are unlucky enough to have your tree cover in 15 or
30m pixels, you may need to disaggregate to greatest common factor (5
or 10m) cells first, then aggregate up to 250m MODIS. With mode on
categorical data, that should still give you your expected results;
with continuous raster values and other functions, it might not be
appropriate.
Tom 2
On Fri, Aug 26, 2016 at 7:28 PM, Bacou, Melanie <mel at mbacou.com
<mailto:mel at mbacou.com>> wrote:
Isaque, check this thread on StackExchange:
http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work
<http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work>
--Mel.
On 8/26/2016 10:07 PM, Isaque Daniel wrote:
> Hi dear all,
>
>
> I need to resample a tree cover map create by Landsat imagery to
the MODIS 250 meters.
>
> If I use the resample function of raster package, it will
compute the value based on bilinear or ngb, in this condition the
new class map will not answer my expectations.
>
>
> I loking for a way of resample using the statistical mode to
define the value of the pixel of the new map.
>
>
> Some tip about this?
>
> Thanks
> Isaque
>
>
>
>
------------------------------------------------------------------------------------------------------------------
> Agronomist engineer
> Master in Remote Sensing - National Institute for Space
Research (INPE) - Brazil
> PHD Student in Transport - Bras?lia University (UNB)
>
> [[alternative HTML version deleted]]
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org <mailto:R-sig-Geo at r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
<https://stat.ethz.ch/mailman/listinfo/r-sig-geo> [[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org <mailto:R-sig-Geo at r-project.org>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
Sorry I meant reproject using nearest neighbor: projectRaster(from, to, method="ngb")
On 8/28/2016 2:37 AM, Bacou, Melanie wrote:
Isaque, If your LandScan raster is at 30m resolution, then best might be to `aggregate()` to as close as 250m (e.g. using `fact=8` or `fact=9` and `fun=modal`), and then use `projectRaster()`: projectRaster(from, to, method="bilinear") Others might have better ideas. --Mel. On 8/26/2016 10:43 PM, Tom Philippi wrote:
Mel's answer is complete if you are aggregating to an integer multiple
of grid cells: if your tree cover was 5, 10, 25, 50, 125, etc., m
pixels. If you are unlucky enough to have your tree cover in 15 or
30m pixels, you may need to disaggregate to greatest common factor (5
or 10m) cells first, then aggregate up to 250m MODIS. With mode on
categorical data, that should still give you your expected results;
with continuous raster values and other functions, it might not be
appropriate.
Tom 2
On Fri, Aug 26, 2016 at 7:28 PM, Bacou, Melanie <mel at mbacou.com
<mailto:mel at mbacou.com>> wrote:
Isaque, check this thread on StackExchange:
http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work
<http://gis.stackexchange.com/questions/177423/r-aggregate-raster-with-mode-function-how-does-it-work>
--Mel.
On 8/26/2016 10:07 PM, Isaque Daniel wrote:
> Hi dear all,
>
>
> I need to resample a tree cover map create by Landsat imagery to
the MODIS 250 meters.
>
> If I use the resample function of raster package, it will
compute the value based on bilinear or ngb, in this condition the
new class map will not answer my expectations.
>
>
> I loking for a way of resample using the statistical mode to
define the value of the pixel of the new map.
>
>
> Some tip about this?
>
> Thanks
> Isaque
>
>
>
>
------------------------------------------------------------------------------------------------------------------
> Agronomist engineer
> Master in Remote Sensing - National Institute for Space
Research (INPE) - Brazil
> PHD Student in Transport - Bras?lia University (UNB)
>
> [[alternative HTML version deleted]]
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org <mailto:R-sig-Geo at r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
<https://stat.ethz.ch/mailman/listinfo/r-sig-geo> [[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org <mailto:R-sig-Geo at r-project.org>
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo