@@ -12,38 +12,31 @@ init_defaults = function() {
1212
1313# run this is preprocess isn't working to check out if anything stands out with the maps
1414# i'll try to add checks to this as needed.
15- debug_spatial = function (template , typepars , streams ) {
16-
17- template = template_read(template = template )
18- maps = as.data.frame(unique(template [[5 ]]))
19- maps = rbind(maps , c(" streams" , streams ))
20-
21- map_paths = file.path(typepars , maps $ Map )
22-
23- maps $ Exists = sapply(map_paths , file.exists )
24-
25- library(raster )
26- # going to assume this might not work, tho this is how they are read normally
27- # map_stack = raster::stack(x = map_paths)
28- map_data = list ()
29- for (i in seq_along(map_paths )) {
30- map_data [[i ]] = raster(map_paths [i ])
31-
32- maps $ extent = paste(map_data [[i ]]@ extent [1 : 4 ])
33- maps $ cellsize = res(map_data [[i ]])
34-
35- maps $ ncell = ncell(map_data [[i ]])
36- maps $ NAs = sum(is.na(values(map_data [[i ]])))
37- maps $ NULLs = sum(is.null(map_data [[i ]]))
38- maps $ proj = paste(crs(map_data [[i ]]@ crs ))
39-
40-
41- }
42-
43- prob = map_stack [values(map_stack $ pch_30m1000.1 ) == 15660 ]
44-
45-
46-
47-
48-
49- }
15+ # debug_spatial = function(template, typepars, streams) {
16+ #
17+ # template = template_read(template = template)
18+ # maps = as.data.frame(unique(template[[5]]))
19+ # maps = rbind(maps, c("streams", streams))
20+ #
21+ # map_paths = file.path(typepars, maps$Map)
22+ #
23+ # maps$Exists = sapply(map_paths, file.exists)
24+ #
25+ # library(raster)
26+ # # going to assume this might not work, tho this is how they are read normally
27+ # #map_stack = raster::stack(x = map_paths)
28+ # map_data = list()
29+ # for (i in seq_along(map_paths)) {
30+ # map_data[[i]] = raster(map_paths[i])
31+ #
32+ # maps$extent = paste(map_data[[i]]@extent[1:4])
33+ # maps$cellsize = res(map_data[[i]])
34+ #
35+ # maps$ncell = ncell(map_data[[i]])
36+ # maps$NAs = sum(is.na(values(map_data[[i]])))
37+ # maps$NULLs = sum(is.null(map_data[[i]]))
38+ # maps$proj = paste(crs(map_data[[i]]@crs))
39+ #
40+ # }
41+ #
42+ # }
0 commit comments