How to mask the area around a raster map with a buffer?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to mask the area around a raster map with a buffer?

R-sig-geo mailing list
Dear all,

I have a dataframe with around 90k observations over an area including a continent (a raster object), and a variable of interest whose values I want to visualize on a map. I have used levelplot function from lattice package to visualize the data, and added a map of the continent to the plot as a layer (using a shapefile). So far, so good.

My area of interest is the continent itself, but my data covers a larger area (including the oceans around the continent). I would like to keep the whole map but mask the ocean around the continent (with a buffer of 100km) and keep the values only for the continent.

I would appreciate it if someone could help me achieve this.

Thank you in advance,
Sohrab

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: How to mask the area around a raster map with a buffer?

Hugo Costa
Hi Sohrab,
without data it's difficult to give a definitive answer. However, a bit of
GIS and/or spatial analysis with raster package (e.g. mask function) may
work for you.
Cheers
Hugo

Sohrab Abbasnejad via R-sig-Geo <[hidden email]> escreveu no dia
quinta, 31/01/2019 à(s) 15:35:

> Dear all,
>
> I have a dataframe with around 90k observations over an area including a
> continent (a raster object), and a variable of interest whose values I want
> to visualize on a map. I have used levelplot function from lattice package
> to visualize the data, and added a map of the continent to the plot as a
> layer (using a shapefile). So far, so good.
>
> My area of interest is the continent itself, but my data covers a larger
> area (including the oceans around the continent). I would like to keep the
> whole map but mask the ocean around the continent (with a buffer of 100km)
> and keep the values only for the continent.
>
> I would appreciate it if someone could help me achieve this.
>
> Thank you in advance,
> Sohrab
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo