e-sensing / sits

Satellite image time series in R
https://e-sensing.github.io/sitsbook/
GNU General Public License v2.0
467 stars 76 forks source link

sits_view fails to load classified cube correctly #1047

Closed gilbertocamara closed 8 months ago

gilbertocamara commented 10 months ago

Describe the bug sits_view is not able to display classified images correctly.

To Reproduce

    # create a local data cube
    data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
    modis_cube <- sits_cube(
        source = "BDC",
        collection = "MOD13Q1-6",
        data_dir = data_dir
    )
    # train a model
    rf_model <- sits_train(samples_modis_ndvi, sits_rfor())
    # classify the cube
    modis_probs <- sits_classify(
        data = modis_cube,
        ml_model = rf_model,
        output_dir = tempdir()
    )
    # view the probs
    sits_view(modis_probs)
    # generate a map
    modis_label <- sits_label_classification(
        modis_probs,
        output_dir = tempdir()
    )
    # view the classified map
    sits_view(modis_label)
gilbertocamara commented 10 months ago

Bug fixed in sits development version.