Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve segments processing in sits_classify #1270

Open
OldLipe opened this issue Jan 20, 2025 · 0 comments
Open

Improve segments processing in sits_classify #1270

OldLipe opened this issue Jan 20, 2025 · 0 comments
Assignees
Milestone

Comments

@OldLipe
Copy link
Contributor

OldLipe commented Jan 20, 2025

Describe the requested improvement
Improve segment parallelization and processing with single-chunk cubes.
Currently, we divide segments into chunks. However, this takes a long time when the cubes have small chunks.
First, we need to check the chunk size and then split the segments.

Associated sits API function

data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
# create a data cube
cube <- sits_cube(
    source = "BDC",
    collection = "MOD13Q1-6.1",
    data_dir = data_dir
)
# segment the vector cube
segments <- sits_segment(
    cube = cube,
    output_dir = tempdir()
)
# create a classification model
rfor_model <- sits_train(samples_modis_ndvi, sits_rfor())
# classify the segments
seg_probs <- sits_classify(
    data = segments,
    ml_model = rfor_model,
    memsize = 1,
    output_dir = tempdir(),
    version = "v2"
)
# label the probability segments
seg_label <- sits_label_classification(
    cube = seg_probs,
    output_dir = tempdir()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants