0

I'm trying to show soil delineations across a 3D topography using Rayshader. All is well until I go to set the polgyon overlay.

Here's where I define the color palette:

qual_col_pals <- brewer.pal.info[brewer.pal.info$category == 'qual',]
col_vector <- unlist(mapply(brewer.pal, qual_col_pals$maxcolors, rownames(qual_col_pals)))
first.colors <- sample(col_vector, n.grp)

And then we get to the polygon overlay part: ov <- generate_polygon_overlay(thematic_shp, data_column_fill = mu.col, heightmap = elmat, extent = raster::extent(elev), palette = first.colors, linewidth = 3, linecolor = "#FFFFFF")

# interactive 3D plot via rgl
elmat %>%
  #ray_shade() %>%
  # (load.array, rescale_original = T) %>%
  sphere_shade(texture = "bw", colorintensity = 0.5) %>%
  add_water(detect_water(elmat, cutoff = 0.99, min_area = 4000,), color="#224466") %>%
  # add_shadow(ambmat, max_darken = 0.4) %>%
  add_overlay(ov, alphalayer = 0.65) %>% 
  plot_3d(elmat, zscale=8, fov=0, theta=30, water = 0,
      zoom=0.75, phi=45, windowsize = c(1000,800), lineantialias = TRUE, baseshape = "rectangle", soliddepth = -100)

The polygon lines appear in the 3D image, but the palette does not.

Polygon lines visible on 3D image, but no color palette

Can anyone spot where this is going sideways?

Have done different palettes with color brewer, have re-arranged the code to see if one overlay is overwriting another overlay

0 Answers0