@@ -24,17 +24,16 @@ IWRMclass <- reclassify(iwrm_harm, rclmat)
24
24
25
25
IWRMclass <- rasterToPolygons(IWRMclass , dissolve = T )
26
26
27
- # Identify non-hotspots and shade on map
28
- basins_data $ faderegs <- rep(NA )
29
- basins_data $ faderegs [basins_data $ ss_vcls < 2 ] <- 1
30
- basins_data_d <- basins_data %> % filter(faderegs == 1 )
31
-
32
- # Identify non-hotspots and shade on map
27
+ # Identify non-hotspots and fade on map
33
28
basins_data $ hotspots <- rep(NA )
34
29
basins_data $ hotspots [basins_data $ ss_vcls > = 2 ] <- 1
35
30
basins_data_h <- basins_data %> % filter(hotspots == 1 )
36
31
basins_data_h <- fasterize(sf = basins_data_h , raster = WGS84_areaRaster(0.5 ))
32
+ basins_data_nh <- 1 - basins_data_h
37
33
basins_data_h <- raster :: rasterToPolygons(basins_data_h , na.rm = T , dissolve = T )
34
+ basins_data_nh [is.na(basins_data_nh )] <- 1
35
+ basins_data_nh [basins_data_nh == 0 ] <- NA
36
+ basins_data_nh <- projectRaster(basins_data_nh , crs = crs(" +proj=robin" ), method = ' ngb' )
38
37
39
38
# Custom palette
40
39
cus.pal <- c(" #D57F31" , " #E8BA24" , " #81BF81" , " #6CBDEF" , " #0D7EB6" )
@@ -44,7 +43,7 @@ tm <- tm_shape(coastlines, projection = "+proj=robin") + tm_fill(col = '#b3b3b3'
44
43
tm_polygons(col = " iwrm_fill" , style = " cat" , palette = cus.pal ,
45
44
lwd = 0 , colorNA = ' #b3b3b3' ) +
46
45
tm_shape(basins_data ) + tm_borders(lwd = 0.2 ) +
47
- tm_shape(basins_data_d ) + tm_fill( col = ' black ' , alpha = 0.5 ) +
46
+ tm_shape(basins_data_nh ) + tm_raster( style = ' cat ' , palette = ' white ' , alpha = 0.75 ) +
48
47
tm_shape(basins_data_h ) + tm_borders(col = ' black' , lwd = 2 ) +
49
48
tm_shape(coastlines ) +
50
49
tm_borders(lwd = 0.7 , col = " black" ) +
0 commit comments