1

I am trying to use R mapview/plainview or leaflet to display a raster RGB with a second layer that is a vector-based (spatial points or polygon) on top that I can toggle on an doff. It is important that both spatial layers are in polar stereographic (EPSG:3031) instead of having them reprojected to the standard EPSG:3857 web mercator projection used by leaflet. Also, I don't need to have any background tiles.

I can use planview to display a raster RGB without issue. The code is:

library(plainview)
plainview(poppendorf, r = 4, g = 3, b = 2)

However, it does not look like I can add a second-vector based layer to this. For example, I don't see a way to do something like:

plainview(poppendorf, r = 4, g = 3, b = 2) +
mapview(...)

Sticking directly with leaflet it seems I might be able to define a custom crs for 3031 here but this would likely not work with raster based leaflet functions, like addRasterRGB.

So is there a way to code such a thing in R? Preferably with the plainview package?

David Scholz
  • 8,421
  • 12
  • 19
  • 34
ccc75
  • 11
  • 2
  • 1
    Unfortunately this is not possible with either plainview or mapview atm. I think it will never be available in plainview, but mapview might be able to display rasters with arbitrary crs soon(ish). – TimSalabim May 20 '22 at 06:16
  • Thanks @TimSalabim for the quick response. Just to clarify - does the fact that I can't do this right now using mapview mean that it is also currently not possible to implement addRasterRGB with a custom crs directly using R leaflet and/or leaflet.extras? – ccc75 May 20 '22 at 16:22
  • I think it should be possible with plain leaflet. – TimSalabim May 21 '22 at 07:10

0 Answers0