Skip to content

Commit 7a3f7e9

Browse files
band names for DEAUSTRALIA collections
1 parent 54273ab commit 7a3f7e9

File tree

4 files changed

+64
-63
lines changed

4 files changed

+64
-63
lines changed

Diff for: inst/extdata/sources/config_source_deaustralia.yml

+51-51
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sources:
1010
collections :
1111
GA_LS5T_ARD_3 :
1212
bands :
13-
NBART_BLUE : &deaustralia_ls5_tm_30m
13+
BLUE : &deaustralia_ls5_tm_30m
1414
missing_value : -999
1515
minimum_value : 0
1616
maximum_value : 65536
@@ -20,19 +20,19 @@ sources:
2020
resolution : 30
2121
band_name : "nbart_blue"
2222
data_type : "INT2S"
23-
NBART_GREEN :
23+
GREEN :
2424
<<: *deaustralia_ls5_tm_30m
2525
band_name: "nbart_green"
26-
NBART_RED :
26+
RED :
2727
<<: *deaustralia_ls5_tm_30m
2828
band_name: "nbart_red"
29-
NBART_NIR :
29+
NIR :
3030
<<: *deaustralia_ls5_tm_30m
3131
band_name: "nbart_nir"
32-
NBART_SWIR_1 :
32+
SWIR_1 :
3333
<<: *deaustralia_ls5_tm_30m
3434
band_name: "nbart_swir_1"
35-
NBART_SWIR_2 :
35+
SWIR_2 :
3636
<<: *deaustralia_ls5_tm_30m
3737
band_name: "nbart_swir_2"
3838
CLOUD :
@@ -63,7 +63,7 @@ sources:
6363
grid_system : "WRS-2"
6464
GA_LS7E_ARD_3 :
6565
bands :
66-
NBART_BLUE : &deaustralia_ls7_etm_30m
66+
BLUE : &deaustralia_ls7_etm_30m
6767
missing_value : -999
6868
minimum_value : 0
6969
maximum_value : 65536
@@ -73,22 +73,22 @@ sources:
7373
resolution : 30
7474
band_name : "nbart_blue"
7575
data_type : "INT2S"
76-
NBART_GREEN :
76+
GREEN :
7777
<<: *deaustralia_ls7_etm_30m
7878
band_name: "nbart_green"
79-
NBART_RED :
79+
RED :
8080
<<: *deaustralia_ls7_etm_30m
8181
band_name: "nbart_red"
82-
NBART_NIR :
82+
NIR :
8383
<<: *deaustralia_ls7_etm_30m
8484
band_name: "nbart_nir"
85-
NBART_SWIR_1 :
85+
SWIR_1 :
8686
<<: *deaustralia_ls7_etm_30m
8787
band_name: "nbart_swir_1"
88-
NBART_SWIR_2 :
88+
SWIR_2 :
8989
<<: *deaustralia_ls7_etm_30m
9090
band_name: "nbart_swir_2"
91-
NBART_PANCHROMATIC :
91+
PANCHROMATIC :
9292
<<: *deaustralia_ls7_etm_30m
9393
resolution : 15
9494
band_name: "nbart_panchromatic"
@@ -121,7 +121,7 @@ sources:
121121

122122
GA_LS8C_ARD_3 :
123123
bands :
124-
NBART_COASTAL_AEROSOL : &deaustralia_ls8_oli_30m
124+
COASTAL-AEROSOL : &deaustralia_ls8_oli_30m
125125
missing_value : -999
126126
minimum_value : 0
127127
maximum_value : 65536
@@ -131,25 +131,25 @@ sources:
131131
resolution : 30
132132
band_name : "nbart_coastal_aerosol"
133133
data_type : "INT2U"
134-
NBART_BLUE :
134+
BLUE :
135135
<<: *deaustralia_ls8_oli_30m
136136
band_name : "nbart_blue"
137-
NBART_GREEN :
137+
GREEN :
138138
<<: *deaustralia_ls8_oli_30m
139139
band_name : "nbart_green"
140-
NBART_RED :
140+
RED :
141141
<<: *deaustralia_ls8_oli_30m
142142
band_name : "nbart_red"
143-
NBART_NIR :
143+
NIR :
144144
<<: *deaustralia_ls8_oli_30m
145145
band_name : "nbart_nir"
146-
NBART_SWIR_1 :
146+
SWIR-1 :
147147
<<: *deaustralia_ls8_oli_30m
148148
band_name : "nbart_swir_1"
149-
NBART_SWIR_2 :
149+
SWIR-2 :
150150
<<: *deaustralia_ls8_oli_30m
151151
band_name : "nbart_swir_2"
152-
NBART_PANCHROMATIC:
152+
PANCHROMATIC:
153153
<<: *deaustralia_ls8_oli_30m
154154
resolution : 15
155155
band_name : "nbart_panchromatic"
@@ -181,7 +181,7 @@ sources:
181181
grid_system : "WRS-2"
182182
GA_LS9C_ARD_3 :
183183
bands :
184-
NBART_COASTAL_AEROSOL : &deaustralia_ls9_oli_30m
184+
COASTAL-AEROSOL : &deaustralia_ls9_oli_30m
185185
missing_value : -999
186186
minimum_value : 0
187187
maximum_value : 65536
@@ -191,25 +191,25 @@ sources:
191191
resolution : 30
192192
band_name : "nbart_coastal_aerosol"
193193
data_type : "INT2U"
194-
NBART_BLUE :
194+
BLUE :
195195
<<: *deaustralia_ls9_oli_30m
196196
band_name : "nbart_blue"
197-
NBART_GREEN :
197+
GREEN :
198198
<<: *deaustralia_ls9_oli_30m
199199
band_name : "nbart_green"
200-
NBART_RED :
200+
RED :
201201
<<: *deaustralia_ls9_oli_30m
202202
band_name : "nbart_red"
203-
NBART_NIR :
203+
NIR :
204204
<<: *deaustralia_ls9_oli_30m
205205
band_name : "nbart_nir"
206-
NBART_SWIR_1 :
206+
SWIR-1 :
207207
<<: *deaustralia_ls9_oli_30m
208208
band_name : "nbart_swir_1"
209-
NBART_SWIR_2 :
209+
SWIR-2 :
210210
<<: *deaustralia_ls9_oli_30m
211211
band_name : "nbart_swir_2"
212-
NBART_PANCHROMATIC:
212+
PANCHROMATIC:
213213
<<: *deaustralia_ls9_oli_30m
214214
resolution : 15
215215
band_name : "nbart_panchromatic"
@@ -242,7 +242,7 @@ sources:
242242

243243
GA_S2AM_ARD_3 :
244244
bands :
245-
NBART_COASTAL_AEROSOL : &deaustralia_s2a_msi_60m
245+
COASTAL-AEROSOL : &deaustralia_s2a_msi_60m
246246
missing_value : -999
247247
minimum_value : 0
248248
maximum_value : 10000
@@ -251,7 +251,7 @@ sources:
251251
resolution : 60
252252
band_name : "nbart_coastal_aerosol"
253253
data_type : "INT2S"
254-
NBART_BLUE : &deaustralia_s2a_msi_10m
254+
BLUE : &deaustralia_s2a_msi_10m
255255
missing_value : -999
256256
minimum_value : 0
257257
maximum_value : 10000
@@ -260,13 +260,13 @@ sources:
260260
resolution : 10
261261
band_name : "nbart_blue"
262262
data_type : "INT2S"
263-
NBART_GREEN :
263+
GREEN :
264264
<<: *deaustralia_s2a_msi_10m
265265
band_name : "nbart_green"
266-
NBART_RED :
266+
RED :
267267
<<: *deaustralia_s2a_msi_10m
268268
band_name : "nbart_red"
269-
NBART_RED_EDGE_1 : &deaustralia_s2a_msi_20m
269+
RED-EDGE-1 : &deaustralia_s2a_msi_20m
270270
missing_value : -999
271271
minimum_value : 0
272272
maximum_value : 10000
@@ -275,22 +275,22 @@ sources:
275275
resolution : 20
276276
band_name : "nbart_red_edge_1"
277277
data_type : "INT2S"
278-
NBART_RED_EDGE_2 :
278+
RED_EDGE_2 :
279279
<<: *deaustralia_s2a_msi_20m
280280
band_name : "nbart_red_edge_2"
281-
NBART_RED_EDGE_3 :
281+
RED_EDGE_3 :
282282
<<: *deaustralia_s2a_msi_20m
283283
band_name : "nbart_red_edge_3"
284-
NBART_NIR_1 :
284+
NIR-1 :
285285
<<: *deaustralia_s2a_msi_10m
286286
band_name : "nbart_nir_1"
287-
NBART_NIR_2 :
287+
NIR-2 :
288288
<<: *deaustralia_s2a_msi_20m
289289
band_name : "nbart_nir_2"
290-
NBART_SWIR_2 :
290+
SWIR-2 :
291291
<<: *deaustralia_s2a_msi_20m
292292
band_name : "nbart_swir_2"
293-
NBART_SWIR_3 :
293+
SWIR-3 :
294294
<<: *deaustralia_s2a_msi_20m
295295
band_name : "nbart_swir_3"
296296
CLOUD :
@@ -323,7 +323,7 @@ sources:
323323
grid_system : "MGRS"
324324
GA_S2BM_ARD_3 :
325325
bands :
326-
NBART_COASTAL_AEROSOL : &deaustralia_s2a_msi_60m
326+
COASTAL-AEROSOL : &deaustralia_s2a_msi_60m
327327
missing_value : -999
328328
minimum_value : 0
329329
maximum_value : 10000
@@ -332,7 +332,7 @@ sources:
332332
resolution : 60
333333
band_name : "nbart_coastal_aerosol"
334334
data_type : "INT2U"
335-
NBART_BLUE : &deaustralia_s2a_msi_10m
335+
BLUE : &deaustralia_s2a_msi_10m
336336
missing_value : -999
337337
minimum_value : 0
338338
maximum_value : 10000
@@ -341,13 +341,13 @@ sources:
341341
resolution : 10
342342
band_name : "nbart_blue"
343343
data_type : "INT2S"
344-
NBART_GREEN :
344+
GREEN :
345345
<<: *deaustralia_s2a_msi_10m
346346
band_name : "nbart_green"
347-
NBART_RED :
347+
RED :
348348
<<: *deaustralia_s2a_msi_10m
349349
band_name : "nbart_red"
350-
NBART_RED_EDGE_1 : &deaustralia_s2a_msi_20m
350+
RED-EDGE-1 : &deaustralia_s2a_msi_20m
351351
missing_value : -999
352352
minimum_value : 0
353353
maximum_value : 10000
@@ -356,22 +356,22 @@ sources:
356356
resolution : 20
357357
band_name : "nbart_red_edge_1"
358358
data_type : "INT2S"
359-
NBART_RED_EDGE_2 :
359+
RED-EDGE-2 :
360360
<<: *deaustralia_s2a_msi_20m
361361
band_name : "nbart_red_edge_2"
362-
NBART_RED_EDGE_3 :
362+
RED-EDGE-3 :
363363
<<: *deaustralia_s2a_msi_20m
364364
band_name : "nbart_red_edge_3"
365-
NBART_NIR_1 :
365+
NIR-1 :
366366
<<: *deaustralia_s2a_msi_10m
367367
band_name : "nbart_nir_1"
368-
NBART_NIR_2 :
368+
NIR-2 :
369369
<<: *deaustralia_s2a_msi_20m
370370
band_name : "nbart_nir_2"
371-
NBART_SWIR_2 :
371+
SWIR-2 :
372372
<<: *deaustralia_s2a_msi_20m
373373
band_name : "nbart_swir_2"
374-
NBART_SWIR_3 :
374+
SWIR-3 :
375375
<<: *deaustralia_s2a_msi_20m
376376
band_name : "nbart_swir_3"
377377
CLOUD :

Diff for: inst/extdata/tmap/api_tmap_v3.R

+11-10
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,15 @@
188188
#' @noRd
189189
#' @param st Stars object.
190190
#' @param labels Class labels
191-
#' @param label_plot Class labels to be plotted
191+
#' @param labels_plot Class labels to be plotted
192192
#' @param palette A sequential RColorBrewer palette
193193
#' @param rev Reverse the color palette?
194194
#' @param scale Scale to plot map (0.4 to 1.0)
195195
#' @param tmap_params List with tmap params for detailed plot control
196196
#' @return A plot object
197197
.tmap_probs_map <- function(probs_st,
198198
labels,
199-
label_plot,
199+
labels_plot,
200200
palette,
201201
rev,
202202
scale,
@@ -212,7 +212,7 @@
212212
#'
213213
.tmap_probs_map.tmap_v3 <- function(probs_st,
214214
labels,
215-
label_plot,
215+
labels_plot,
216216
palette,
217217
rev,
218218
scale,
@@ -222,15 +222,16 @@
222222
palette <- paste0("-", palette)
223223
}
224224
# select stars bands to be plotted
225-
bds <- as.numeric(names(labels[labels %in% label_plot]))
225+
bds <- as.numeric(names(labels[labels %in% labels_plot]))
226226

227227
p <- tmap::tm_shape(probs_st[, , , bds]) +
228228
tmap::tm_raster(
229229
style = "cont",
230230
palette = palette,
231231
midpoint = NA,
232-
title = labels[labels %in% label_plot]
232+
title = labels[labels %in% labels_plot]
233233
) +
234+
tmap::tm_facets(sync = FALSE) +
234235
tmap::tm_graticules(
235236
labels.size = tmap_params[["graticules_labels_size"]]
236237
) +
@@ -258,12 +259,12 @@
258259
#' @param palette A sequential RColorBrewer palette
259260
#' @param rev Reverse the color palette?
260261
#' @param labels Class labels
261-
#' @param label_plot Class label to be plotted
262+
#' @param labels_plot Class labels to be plotted
262263
#' @param scale Scale to plot map (0.4 to 1.0)
263264
#' @param tmap_params Tmap parameters
264265
#' @return A plot object
265266
.tmap_vector_probs <- function(sf_seg, palette, rev,
266-
labels, label_plot,
267+
labels, labels_plot,
267268
scale, tmap_params){
268269
if (as.numeric_version(utils::packageVersion("tmap")) < "3.9")
269270
class(sf_seg) <- "tmap_v3"
@@ -273,7 +274,7 @@
273274
}
274275
#' @export
275276
.tmap_vector_probs.tmap_v3 <- function(sf_seg, palette, rev,
276-
labels, label_plot,
277+
labels, labels_plot,
277278
scale, tmap_params){
278279
# revert the palette?
279280
if (rev) {
@@ -283,11 +284,11 @@
283284
# plot the segments
284285
p <- tmap::tm_shape(sf_seg) +
285286
tmap::tm_fill(
286-
label_plot,
287+
labels_plot,
287288
style = "cont",
288289
palette = palette,
289290
midpoint = NA,
290-
title = labels[labels %in% label_plot]) +
291+
title = labels[labels %in% labels_plot]) +
291292
tmap::tm_graticules(
292293
labels.size = tmap_params[["graticules_labels_size"]]
293294
) +

Diff for: man/plot.probs_vector_cube.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: tests/testthat/test-plot.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ test_that("Plot Time Series and Images", {
6767
)
6868
p_probs <- plot(sinop_probs)
6969
expect_equal(p_probs$tm_raster$palette, "YlGn")
70-
expect_equal(length(p_probs$tm_raster$title), 1)
70+
expect_equal(length(p_probs$tm_raster$title), 4)
7171
expect_equal(p_probs$tm_layout$legend.bg.color, "white")
7272

7373
p_probs_f <- plot(sinop_probs, labels = "Forest")

0 commit comments

Comments
 (0)