The current implementation of getTiles and getPngLayer does not account for pngs with transparency. I have made an implementation here, basically assessing if the raw png has a fourth channel (alpha channel) and if so, replacing the RGB values for NA before rasterising.
The current implementation of
getTiles
andgetPngLayer
does not account for pngs with transparency. I have made an implementation here, basically assessing if the raw png has a fourth channel (alpha channel) and if so, replacing the RGB values forNA
before rasterising.https://github.com/dieghernan/cartography/blob/646d2d502fd4f5fb5e2409ce41321120dae8e94f/R/getTiles.R#L222:L233
https://github.com/dieghernan/cartography/blob/646d2d502fd4f5fb5e2409ce41321120dae8e94f/R/getPngLayer.R#L41:L71
Check with