aux
This commit is contained in:
24
calculator/proj.go
Normal file
24
calculator/proj.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package calculator
|
||||
|
||||
import "github.com/twpayne/go-proj/v10"
|
||||
|
||||
func J2000ToLngLat(x, y, z float64) []float64 {
|
||||
var lng, lat float64
|
||||
return []float64{lng, lat}
|
||||
}
|
||||
|
||||
func WGS84XYZtoLngLat(x, y, z float64) []float64 {
|
||||
var lng, lat float64
|
||||
pj, err := proj.NewCRSToCRS("EPSG:3857", "EPSG:4326", nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
coor := proj.NewCoord(x, y, z, 0)
|
||||
coor, err = pj.Forward(coor)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
lng = coor.X()
|
||||
lat = coor.Y()
|
||||
return []float64{lng, lat}
|
||||
}
|
||||
Reference in New Issue
Block a user