mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-04-04 01:37:03 +00:00
Improve geohash test, make it easier to read the log
This commit is contained in:
parent
da1a75ec39
commit
43eec44579
@ -2434,7 +2434,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
|
||||
LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time())
|
||||
<< " UTC using " << d_user_pvt_solver->get_num_valid_observations() << " observations is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude()
|
||||
<< " [deg], Height = " << d_user_pvt_solver->get_height() << " [m]";
|
||||
LOG(INFO) << "geohash: " << d_geohash->encode(d_user_pvt_solver->get_latitude(), d_user_pvt_solver->get_longitude());
|
||||
LOG(INFO) << "geohash=" << d_geohash->encode(d_user_pvt_solver->get_latitude(), d_user_pvt_solver->get_longitude());
|
||||
/* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time())
|
||||
<< " UTC using "<< d_user_pvt_solver->get_num_valid_observations() <<" observations is HDOP = " << d_user_pvt_solver->get_hdop() << " VDOP = "
|
||||
<< d_user_pvt_solver->get_vdop()
|
||||
|
@ -22,18 +22,28 @@ TEST(Geohash_Test, Encode)
|
||||
std::string geohash;
|
||||
EXPECT_NO_THROW(geohash = gh.encode(52.205, 0.119, 7));
|
||||
EXPECT_EQ(0, geohash.compare("u120fxw"));
|
||||
EXPECT_NO_THROW(geohash = gh.encode(41.274966141209, 1.987518053501));
|
||||
EXPECT_EQ(0, geohash.compare("sp36v1zk0e2g"));
|
||||
EXPECT_THROW(gh.encode(52.205, 0.119, 0), std::invalid_argument);
|
||||
}
|
||||
|
||||
|
||||
TEST(Geohash_Test, Decode)
|
||||
{
|
||||
Geohash gh = Geohash();
|
||||
auto latlon = gh.decode("sp36v1zk0e2g");
|
||||
EXPECT_NEAR(41.274966141209006, latlon[0], 1e-8);
|
||||
EXPECT_NEAR(1.9875180535018444, latlon[1], 1e-8);
|
||||
EXPECT_NEAR(41.274966141209, latlon[0], 1e-8);
|
||||
EXPECT_NEAR(1.987518053501, latlon[1], 1e-8);
|
||||
EXPECT_THROW(gh.decode(""), std::runtime_error);
|
||||
latlon = gh.decode("w21zd2mkt");
|
||||
EXPECT_NEAR(1.320527, latlon[0], 1e-8);
|
||||
EXPECT_NEAR(103.81726, latlon[1], 1e-8);
|
||||
latlon = gh.decode("W21ZD2MKT");
|
||||
EXPECT_NEAR(1.320527, latlon[0], 1e-8);
|
||||
EXPECT_NEAR(103.81726, latlon[1], 1e-8);
|
||||
}
|
||||
|
||||
|
||||
TEST(Geohash_Test, Precision)
|
||||
{
|
||||
Geohash gh = Geohash();
|
||||
|
Loading…
x
Reference in New Issue
Block a user