def test_long_to_zone(self): """Tests long_to_zone() http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html""" self.assertEqual(utm.long_to_zone(13.73), 33) self.assertEqual(utm.long_to_zone(23.0), 34) self.assertEqual(utm.long_to_zone(42.0), 38)
def test_utm_latlong(self): """Test utm to latlong and latlong to utm by trying 100 coordinates in both functions. What about southern hemisphere?!??""" for lat in xrange(10): for lon in xrange(10): zone = utm.long_to_zone(lon) coords = utm.latlong_to_utm(lat, lon, zone) coords = utm.utm_to_latlong(coords[0], coords[1], zone, False) self.assertEqual(round_utm_coord(coords[0]), lat) self.assertEqual(round_utm_coord(coords[1]), lon)