Commit 81faec77 authored by Jordan P. Lefebvre's avatar Jordan P. Lefebvre
Browse files

Adding additional unit tests on ConversionCoordinate::LatLon2UTM.

parent 5e9a22e5
Pipeline #12890 failed with stages
in 6 minutes and 12 seconds
......@@ -160,7 +160,7 @@ class RADIX_PUBLIC CoordinateConversion
static void validate(double latitude, double longitude);
/**
* @brief validate Validates coordinate
* @parm point where point.first is latitutde and point.second is longitude
* @param point where point.first is latitutde and point.second is longitude
* Throws std::out_of_range exception if latitude is outside [-90.,90.] or
* longitude must be [-180,180).
*/
......@@ -170,4 +170,4 @@ class RADIX_PUBLIC CoordinateConversion
}; // class CoordinateConversion
} // namespace radix
#endif /** RADIX_RADIXGEO_COORDINATECONVERSION_HH_ */
\ No newline at end of file
#endif /** RADIX_RADIXGEO_COORDINATECONVERSION_HH_ */
......@@ -169,4 +169,52 @@ TEST(Radixgeo, LatLon2UTM)
EXPECT_EQ('G', utm.lattitude_zone);
EXPECT_EQ(683473, utm.easting);
EXPECT_EQ(4942631, utm.northing);
utm = conv.toUTM(-12.7650, -33.8765);
EXPECT_EQ(25, utm.longitude_zone);
EXPECT_EQ('L', utm.lattitude_zone);
EXPECT_EQ(404859, utm.easting);
EXPECT_EQ(8588690, utm.northing);
utm = conv.toUTM(-80.5434, -170.6540);
EXPECT_EQ(2, utm.longitude_zone);
EXPECT_EQ('C', utm.lattitude_zone);
EXPECT_EQ(506346, utm.easting);
EXPECT_EQ(1057742, utm.northing);
utm = conv.toUTM(90.0000, 177.0000);
EXPECT_EQ(60, utm.longitude_zone);
EXPECT_EQ('Z', utm.lattitude_zone);
EXPECT_EQ(500000, utm.easting);
EXPECT_EQ(9997964, utm.northing);
utm = conv.toUTM(-90.0000, -177.0000);
EXPECT_EQ(1, utm.longitude_zone);
EXPECT_EQ('A', utm.lattitude_zone);
EXPECT_EQ(500000, utm.easting);
EXPECT_EQ(2035, utm.northing);
utm = conv.toUTM(90.0000, 3.0000);
EXPECT_EQ(31, utm.longitude_zone);
EXPECT_EQ('Z', utm.lattitude_zone);
EXPECT_EQ(500000, utm.easting);
EXPECT_EQ(9997964, utm.northing);
utm = conv.toUTM(23.4578, -135.4545);
EXPECT_EQ(8, utm.longitude_zone);
EXPECT_EQ('Q', utm.lattitude_zone);
EXPECT_EQ(453580, utm.easting);
EXPECT_EQ(2594272, utm.northing);
utm = conv.toUTM(77.3450, 156.9876);
EXPECT_EQ(57, utm.longitude_zone);
EXPECT_EQ('X', utm.lattitude_zone);
EXPECT_EQ(450793, utm.easting);
EXPECT_EQ(8586116, utm.northing);
utm = conv.toUTM(-89.3454, -48.9306);
EXPECT_EQ(22, utm.longitude_zone);
EXPECT_EQ('A', utm.lattitude_zone);
EXPECT_EQ(502639, utm.easting);
EXPECT_EQ(75072, utm.northing);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment