def test_2(self): m = MercatorProjection(10) coord = m.rev_geocode((-122, 37)) self.assertAlmostEqual(-2.129, coord[0], 3) self.assertAlmostEqual(0.696, coord[1], 3) pt = m.geocode((-2.129, 0.696), 10.000) self.assertAlmostEqual(-121.983, pt[0], 3) self.assertAlmostEqual(37.001, pt[1], 3)
def test_1(self): m = MercatorProjection(10) coord = m.rev_geocode((0, 0)) self.assertAlmostEqual(0.0, coord[0]) self.assertAlmostEqual(0.0, coord[1]) pt = m.geocode((0, 0), 10) self.assertAlmostEqual(0.0, pt[0]) self.assertAlmostEqual(0.0, pt[1])