From 7aade116bebbf9722921cfc47632e26b1f04d57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 4 Jul 2024 17:57:06 +0800 Subject: [PATCH] 1 --- platformapi/baidunavi/baidunavi_test.go | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/platformapi/baidunavi/baidunavi_test.go b/platformapi/baidunavi/baidunavi_test.go index d5945da7..ac6040ee 100644 --- a/platformapi/baidunavi/baidunavi_test.go +++ b/platformapi/baidunavi/baidunavi_test.go @@ -2,6 +2,7 @@ package baidunavi import ( "fmt" + "math" "testing" "git.rosy.net.cn/baseapi" @@ -1354,15 +1355,25 @@ var cc []string = []string{ } func TestBatchCoordinateConvertBai2Gao(t *testing.T) { - - result, err := api.BatchCoordinateConvertBai2Gao(cc, "5") + fmt.Println(len(cc)) + result, err := api.BatchCoordinateConvertBai2Gao(cc[0:100], "5") fmt.Println(err) fmt.Println(result) } +// 1290 104.00734814129,30.660267081943 func TestName(t *testing.T) { - syncStatus := 1 - syncStatus |= 32 - fmt.Println(syncStatus) + var bd_lng = 104.00734814129 + var bd_lat = 30.660267081943 + var XPI = math.Pi * 3000.0 / 180.0 + var x = bd_lng - 0.0065 + var y = bd_lat - 0.006 + var z = math.Sqrt(x*x+y*y) - 0.00002*math.Sin(y*XPI) + var theta = math.Atan2(y, x) - 0.000003*math.Cos(x*XPI) + var gg_lng = z * math.Cos(theta) + var gg_lat = z * math.Sin(theta) + + fmt.Println(gg_lng) + fmt.Println(gg_lat) }