report fus
This commit is contained in:
15
cmd/fus.go
15
cmd/fus.go
@@ -4,6 +4,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/airbusgeo/godal"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
producer "starwiz.cn/sjy01/image-proc/pkg/producer"
|
||||
@@ -13,6 +14,7 @@ var (
|
||||
panImage string
|
||||
mssImage string
|
||||
outputDir string
|
||||
fusReport string
|
||||
)
|
||||
|
||||
var fusCmd = &cobra.Command{
|
||||
@@ -24,18 +26,26 @@ var fusCmd = &cobra.Command{
|
||||
fusedTiff := filepath.Base(mssImage)
|
||||
fusedTiff = strings.Replace(fusedTiff, "MSS", "FUS", -1)
|
||||
id := strings.TrimSuffix(fusedTiff, filepath.Ext(fusedTiff))
|
||||
if fusReport == "" {
|
||||
fusReport = filepath.Join(outputDir, id+"_report.xml")
|
||||
}
|
||||
|
||||
err := producer.GDALPansharpen(panImage, mssImage, filepath.Join(outputDir, fusedTiff))
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
godal.RegisterAll()
|
||||
producer.GTiffToJPG(filepath.Join(outputDir, fusedTiff), filepath.Join(outputDir, id+".jpg"), true)
|
||||
|
||||
var report producer.Report
|
||||
report.Satellite = "SJY01"
|
||||
report.Sensor = "FUS"
|
||||
report.Scenes = append(report.Scenes, producer.ReportScene{
|
||||
TiffData: fusedTiff,
|
||||
TiffData: filepath.Join(outputDir, fusedTiff),
|
||||
BrowserData: filepath.Join(outputDir, id+".jpg"),
|
||||
})
|
||||
producer.WriteReport(&report, filepath.Join(outputDir, id+"_report.xml"))
|
||||
producer.WriteReport(&report, fusReport)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -61,4 +71,5 @@ func initFUSParams() {
|
||||
panImage = task.InputFileList.PanTiff
|
||||
mssImage = task.InputFileList.MssTiff
|
||||
outputDir = task.Params.OutputPath
|
||||
fusReport = task.Params.ReportFile
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user