func TestLongitude(t *testing.T) { tx.CheckClose2(t, LongitudeLen(0), 111320, 1) tx.CheckClose2(t, LongitudeLen(15), 107550, 1) tx.CheckClose2(t, LongitudeLen(30), 96486, 1) tx.CheckClose2(t, LongitudeLen(45), 78847, 1) tx.CheckClose2(t, LongitudeLen(60), 55800, 1) tx.CheckClose2(t, LongitudeLen(75), 28902, 1) tx.CheckClose2(t, LongitudeLen(90), 0.000, 1) }
func TestLatitude(t *testing.T) { tx.CheckClose2(t, LatitudeLen(0), 110574, 1) tx.CheckClose2(t, LatitudeLen(15), 110649, 1) tx.CheckClose2(t, LatitudeLen(30), 110852, 1) tx.CheckClose2(t, LatitudeLen(45), 111132, 1) tx.CheckClose2(t, LatitudeLen(60), 111412, 1) tx.CheckClose2(t, LatitudeLen(75), 111618, 1) tx.CheckClose2(t, LatitudeLen(90), 111694, 1) }
func TestFromLatLon(t *testing.T) { known_values := [...]point{ // Aachen, Germany point{50.77535, 6.08389, 294409, 5628898}, // New York, USA point{40.71435, -74.00597, 583960, 4507523}, // Wellington, New Zealand point{-41.28646, 174.77624, 313784, 5427057}, // Capetown, South Africa point{-33.92487, 18.42406, 261878, 6243186}, // Mendoza, Argentina point{-32.89018, -68.84405, 514586, 6360877}, // Fairbanks, Alaska, USA point{64.83778, -147.71639, 466013, 7190568}, // Ben Nevis, Scotland, UK point{56.79680, -5.00601, 377486, 6296562}, } for _, point := range known_values { eastings, northings := FromLatLon(point.Latitude, point.Longitude) tx.CheckClose2(t, point.Eastings, eastings, 1) tx.CheckClose2(t, point.Northings, northings, 1) } }