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

任意座標を原点とした横メルカトルへの対応 #16

Merged
merged 8 commits into from
Mar 17, 2025
Prev Previous commit
Next Next commit
feat: update test for TM
Tomoya-Sato committed Mar 14, 2025
commit 792a7ea7cf29106081eefd1cbd3fe2c400254f0c
16 changes: 14 additions & 2 deletions test/height_converter_test.cpp
Original file line number Diff line number Diff line change
@@ -124,17 +124,29 @@ int main(int argc, char** argv)
double test_lat = 35.5, test_lon = 135.5;

double x, y, z;
std::cout << "TEST MGRS" << std::endl;
std::cout << "Testing MGRS ... ";
llh_converter.convertDeg2XYZ(test_lat, test_lon, 50, x, y, z, param);
test2(x, y, 45346.7389, 28608.3575);

// Test JPRCS
param.projection_method = llh_converter::ProjectionMethod::JPRCS;
param.grid_code = std::to_string(5);

std::cout << "TEST JPRCS" << std::endl;
std::cout << "Testing JPRCS ... ";
llh_converter.convertDeg2XYZ(test_lat, test_lon, 50, x, y, z, param);
test2(x, y, 105842.7741, -54845.8269);

// Test TM
param.projection_method = llh_converter::ProjectionMethod::TM;
param.tm_param.inv_flatten_ratio = 298.257222101;
param.tm_param.semi_major_axis = 6378137.0;
param.tm_param.scale_factor = 0.9996;
param.tm_param.origin_lat_rad = 35.5 * M_PI / 180.;
param.tm_param.origin_lon_rad = 135.5 * M_PI / 180.;

std::cout << "Testing TM ... ";
llh_converter.convertDeg2XYZ(test_lat, test_lon, 50, x, y, z, param);
test2(x, y, 0.0, 0.0);

return 0;
}