Closed SimonDedman closed 11 months ago
See /home/simon/Dropbox/Blocklab Monterey/Blocklab/MapRasterFn.R Already kinda done? Just use this code?
done 2023-08-01 finally. Need to check it works, esp with gbm.rsb,
Todo: unrep exponential breaks for RSB legend: breaks = exp01seq gbm.auto L1847 linear01seq <- seq(from = 0, to = 1, length.out = 9) #linear sequence from 0:1, 9 bins exp01seq <- expm1(4*linear01seq)/expm1(4) # exponentiate to change shape then scale back to 1
gbm.auto allow entry for user preference elements, google, etc.
remove Hans as gbm.auto author since the stuff he contributed to is gone?
gbm.map uses plot construction & draw.shape which needs shapefiles via shapefiles::read.shapefile
I get around this in gbm.basemap by saving the cropped shp then reading it back in with shapefiles, but could avoid this if I fixed gbm.map's draw.shape call, pulling the guts from draw.shape and recreating this section:
draw.shape
lapply(shape$shp$shp, function(x) { if (is.null(shape$dbf$dbf$col) == F) col = shape$dbf$dbf$col[x$record] start <- x$parts + 1 end <- c(x$parts[-1], x$num.points) i <- unlist(apply(cbind(start, end), 1, function(x) c(x[1]:x[2], NA))) if (type == "poly") polygon(x$points[i, ], col = col, ...) }) box()
But at that point probably I should just plot these all as a map in ggplot.