Skip to content

Commit 562d020

Browse files
committed
fix:国土図郭の範囲のロジック修正とテストを通るように
1 parent 23fb6b1 commit 562d020

File tree

3 files changed

+436
-210
lines changed

3 files changed

+436
-210
lines changed

include/plateau/dataset/standard_map_grid.h

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,43 +54,23 @@ namespace plateau::dataset {
5454
bool operator==(const StandardMapGrid& other) const;
5555
bool operator<(const StandardMapGrid& other) const;
5656

57+
/**
58+
* \brief 図郭コードから平面直角座標系での範囲を計算します。
59+
* \return 平面直角座標系での範囲(min, max)
60+
*/
61+
std::pair<TVec3d, TVec3d> calculateGridExtent() const;
62+
5763
private:
5864
std::string code_; // 図郭コード
5965
bool is_valid_ = true; // コードが有効かどうか
6066
StandardMapGridLevel level_;
6167

6268
int coordinate_origin_; // 原点
63-
char first_row_; // 1文字目の行(A-T
64-
char first_col_; // 2文字目の列(A-H
69+
char first_row_; // 1文字目はrow座標(東西, A-H
70+
char first_column_; // 2文字目はcolumn座標(南北, A-T
6571
int second_row_;
66-
int second_col_;
72+
int second_column_;
6773
int third_row_;
68-
int third_col_;
69-
70-
/**
71-
* \brief 図郭コードから平面直角座標系での範囲を計算します。
72-
* \return 平面直角座標系での範囲(min, max)
73-
*/
74-
std::pair<TVec3d, TVec3d> calculateGridExtent() const;
75-
76-
/**
77-
* サブグリッドの範囲を計算します。
78-
* @param min_x 最小X座標(入出力)
79-
* @param min_y 最小Y座標(入出力)
80-
* @param max_x 最大X座標(出力)
81-
* @param max_y 最大Y座標(出力)
82-
* @param row_index 行インデックス
83-
* @param col_index 列インデックス
84-
* @param cell_width セルの幅
85-
* @param cell_height セルの高さ
86-
* @param is_x_right X方向の向き(右方向ならtrue)
87-
* @param is_y_upper Y方向の向き(上方向ならtrue)
88-
*/
89-
void calculateSubGridExtent(
90-
double& min_x, double& min_y,
91-
double& max_x, double& max_y,
92-
int row_index, int col_index,
93-
double cell_width, double cell_height,
94-
bool is_x_right, bool is_y_upper) const;
74+
int third_column_;
9575
};
96-
}
76+
}

0 commit comments

Comments
 (0)