Skip to content

Commit

Permalink
Squashed 'seims/src/ccgl/' changes from 130ed1dbd..7441ea465
Browse files Browse the repository at this point in the history
7441ea465 Merge pull request #6 from crazyzlj/dev
4a2f38bad Merge branch 'dev' of github.com:crazyzlj/CCGL into dev
32a5bd3c0 bug fixed: check when needs to recalc subset

git-subtree-dir: seims/src/ccgl
git-subtree-split: 7441ea465772b22e2c7ffe9373d335c0fc3d74ad
  • Loading branch information
crazyzlj committed Apr 14, 2023
1 parent de46ac8 commit db18923
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/data_raster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3808,26 +3808,26 @@ int clsRasterData<T, MASK_T>::MaskAndCalculateValidPosition() {
recalc_pos = !match_exactly;
upd_header_valid_num = recalc_pos;
store_fullsize = false;
recalc_subset = mask_has_subset && !match_exactly;
//recalc_subset = mask_has_subset && !match_exactly;
} else { // calc_pos_ = false
recalc_pos = false;
upd_header_valid_num = false;
store_fullsize = false;
calc_pos_ = true; // use_mask_ext_ is priority
recalc_subset = mask_has_subset && !match_exactly;
//recalc_subset = mask_has_subset && !match_exactly;
}
} else { // use_mask_ext_ is false
if (calc_pos_) {
recalc_pos = !match_exactly;
upd_header_valid_num = recalc_pos;
store_fullsize = false;
recalc_subset = mask_has_subset && !match_exactly;
//recalc_subset = mask_has_subset && !match_exactly;
} else { // calc_pos_ = false
recalc_pos = false;
upd_header_valid_num = true;
store_fullsize = false;
calc_pos_ = true; // use_mask_ext_ is priority
recalc_subset = mask_has_subset && !match_exactly;
//recalc_subset = mask_has_subset && !match_exactly;
}
}
} else { // within_ext is false
Expand All @@ -3837,29 +3837,31 @@ int clsRasterData<T, MASK_T>::MaskAndCalculateValidPosition() {
recalc_pos = !match_exactly;
upd_header_valid_num = recalc_pos;
store_fullsize = false;
recalc_subset = mask_has_subset && !match_exactly;
//recalc_subset = mask_has_subset && !match_exactly;
} else { // calc_pos_ = false
recalc_pos = false;
upd_header_valid_num = false;
store_fullsize = false;
calc_pos_ = true; // use_mask_ext_ is priority
recalc_subset = mask_has_subset && !match_exactly;
//recalc_subset = mask_has_subset && !match_exactly;
}
} else { // use_mask_ext_ is false
upd_header_rowcol = true;
upd_header_valid_num = true;
if (calc_pos_) {
recalc_pos = true;
store_fullsize = false;
recalc_subset = mask_has_subset && !match_exactly;
//recalc_subset = mask_has_subset && !match_exactly;
} else { // calc_pos_ = false
recalc_pos = false;
store_fullsize = true;
recalc_subset = mask_has_subset && !match_exactly;
//recalc_subset = mask_has_subset && !match_exactly;
}
}
}

if (mask_has_subset && !match_exactly && upd_header_rowcol) {
recalc_subset = true;
}
// Update row and col counts in header information firstly.
if (upd_header_rowcol) {
UpdateHeader(headers_, HEADER_RS_NROWS, new_rows);
Expand Down Expand Up @@ -3969,7 +3971,7 @@ int clsRasterData<T, MASK_T>::MaskAndCalculateValidPosition() {
UpdateHeader(headers_, HEADER_RS_CELLSNUM, n_cells_);
}

if (recalc_subset) { // check former assigned mask's subset
if (mask_has_subset) { // check former assigned mask's subset
for (auto it = subset_.begin(); it != subset_.end();) {
int count = 0;
int srow = nrows;
Expand Down

0 comments on commit db18923

Please sign in to comment.