This commit is contained in:
nuknal
2024-06-13 20:33:42 +08:00
parent cd9a534458
commit 268076017e
7 changed files with 173 additions and 12 deletions

View File

@@ -1,7 +1,10 @@
package producer
import (
"encoding/json"
"fmt"
"math"
"os"
"time"
log "github.com/sirupsen/logrus"
@@ -9,6 +12,7 @@ import (
"github.com/duke-git/lancet/v2/mathutil"
"github.com/paulmach/orb"
"github.com/paulmach/orb/geo"
"github.com/paulmach/orb/geojson"
"github.com/paulmach/orb/planar"
"starwiz.cn/sjy01/image-proc/pkg/auxilary"
"starwiz.cn/sjy01/image-proc/pkg/calculator"
@@ -20,6 +24,20 @@ func (r *Registrator) LoadAuxData() error {
return err
}
// 数据校验和测试
func (r *Registrator) AuxPrint() {
var fcPos84 geojson.FeatureCollection
for _, p := range r.AuxPlatforms {
lat, lon, _ := calculator.WGS84XYZtoLatLngH(p.W84PosX, p.W84PosY, p.W84PosZ)
point := orb.Point{lon, lat}
fcPos84.Features = append(fcPos84.Features, geojson.NewFeature(point))
}
data, _ := json.Marshal(fcPos84)
f, _ := os.Create(fmt.Sprintf("log/%s_aux_pos_84.geojson", r.Params.DataId))
defer f.Close()
f.Write(data)
}
func (r *Registrator) SceneImageTime(scene *Scene) (start, center, end time.Time) {
startPosInAux, endPosInAux := r.SceneInAuxIndex(scene)
centerPosInAux := (startPosInAux + endPosInAux) / 2

View File

@@ -17,6 +17,7 @@ type Params struct {
FusTIffFile string
SubScenes bool
ReportFile string
DataId string
}
type XMLImageTask struct {