Altering Linewidth and Color for LineString Objects in Mapview

763 Views Asked by At

I'm working with reefs across a large area and trying to visualize them quickly such that I can pick a smaller subset to work on initially. To do this, I have taken my spatial points, transformed them to LineString to make the mapping quicker and then used mapview to display them. The code I have is below:

data_as_sf %>%
  filter(reef_name %in% subgroup) %>%
  group_by(.dots=c("reef_name", "reef_section")) %>%
  summarize() %>%
  st_cast("LINESTRING") %>%
  mapview()

A zoomed in sample of the mapview generated is here: enter image description here

If anyone can provide advice such that I can

  • make the lines bigger/thicker so they are more easily seen when zoomed out, and
  • have the lines colored by the factor "reef_name"

it would really help.

1

There are 1 best solutions below

0
On

As answered in the comments by TimSalabim, have now updated the code to be

data_as_sf %>%
  filter(reef_name %in% subgroup) %>%
  group_by(.dots=c("reef_name", "reef_section")) %>%
  summarize() %>%
  st_cast("LINESTRING") %>%
  mapview(lwd = 3, zcol = "reef_name")

which works just right.