neilcharles / geoviz

Functions to make it easy to process DEM data and add GPS traces to rstats Rayshader scenes, and to overlay mapbox and elevation shading imagery
http://www.hilltop-analytics.com
103 stars 11 forks source link

slippy_overlay stamen - terrain combination requires RasterBrick #26

Closed carbonmetrics closed 5 years ago

carbonmetrics commented 5 years ago

Changing the image type to "terrain" gives an error:

stamen_overlay <- slippy_overlay(DEM, image_source = "stamen",
+                                  image_type = "terrain",
+                                  png_opacity = 0.3)
Error in slippymath::raster_to_png(raster_out, temp_map_image) : 
  tile raster must be a RasterBrick. This is output from tg_composite().

Changing to "toner" fails in the plotting phase:

rayshader::plot_3d(
+   scene,
+   elmat,
+   zscale = zscale,
+   solid = FALSE,
+   shadow = TRUE,
+   shadowdepth = -100
+ )
Error in png::writePNG(hillshade, filename) : 
  image must be a matrix or array of raw or real numbers
neilcharles commented 5 years ago

Thanks. Stamen Toner fixed by #30. Stamen Terrain turns out to be returning a DEM, not an image, so removed it in documentation. Might create stamen_dem() to go with mapbox_dem() and mapzen_dem() but it wouldn't add much as resolution is 25m, so not an improvement.