26 lines
582 B
Go
26 lines
582 B
Go
package proj
|
|
|
|
import (
|
|
_ "embed"
|
|
"github.com/dop251/goja"
|
|
)
|
|
|
|
//go:embed proj4.js
|
|
var proj4 string
|
|
|
|
var CGCS2000_to_WGS84 func(degrees int, cscs2000 [][]string) string
|
|
var WGS84_to_CGCS2000 func(degrees int, wgs84 [][]string) string
|
|
|
|
func InitProj() {
|
|
vm := goja.New()
|
|
vm.RunString(proj4)
|
|
vm.ExportTo(vm.Get("CGCS2000_to_WGS84"), &CGCS2000_to_WGS84)
|
|
vm.ExportTo(vm.Get("WGS84_to_CGCS2000"), &WGS84_to_CGCS2000)
|
|
//var ss [][]string
|
|
//ss = append(ss, []string{
|
|
// "106.545463204423", "23.467020901621", "805.6832",
|
|
//})
|
|
//s := WGS84_to_CGCS2000(108, ss)
|
|
//fmt.Println(s)
|
|
}
|