[R] Rasterize function with maximum in R

Bert Gunter bgunter.4567 at gmail.com
Wed Nov 15 23:13:13 CET 2017

I believe you should post this on the r-sig-geo list, not here. You are
much more likely to find the relevant expertise there.


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Wed, Nov 15, 2017 at 7:13 AM, Ashraf Afana via R-help <
r-help at r-project.org> wrote:

> Hi all,
> I have some concerns regarding the rasterize option in R and I would like
> to know if the fun=max in rasterize in R provides similar results to the
> one achieved by using "Polygon to Raster using maximum-combined-area" in
> ArcGIS?
> I'm trying to rasterize a habitat layer to a raster of 10m spatial
> resolution using the function 'max' (e.g. r <- rasterize(ht, r, "Priority",
> fun = 'max') and I would like to assign the habitat of the largest
> overlapping area, which is similar to the “maximum-combined-area”. My
> original layer contains the habitat information as a character string
> values (e.g. K1, K2, I1, I2, I3, etc.) of 20 classes. Before resterizing, I
> have converted these classes to numeric (e.g. in my case 1 to 20).
> I have my doubts about the validity and type of maximums generated by this
> code. From what I can see, I’m not sure if the use of fun= ‘max’ in
> Rasterize in R implies the use of the absolute maximum or the combined
> maximum area. My point is if I convert the original character string values
> of Priority to numeric, the maximum for the numeric values will have
> nothing to do with the maximum combined area under cover. For example, if
> we have a pixel which is covered by 90% of habitat 1 and 10% of habitat 15,
> the value of the pixel will be assigned to the habitat 15. Does that make
> any sense? Any suggestion or clarification would be appreciated.Regards
>  Ashraf,
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list