暂时使用星下点坐标作为图像左上角坐标

This commit is contained in:
nuknal
2024-05-30 18:11:42 +08:00
parent e4d6b35702
commit 8f2b297a02
25 changed files with 1710 additions and 84 deletions

38
cmd/fus.go Normal file
View File

@@ -0,0 +1,38 @@
package main
import (
"path/filepath"
"strings"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
producer "starwiz.cn/sjy01/image-proc/pkg/producer"
)
var (
panImage string
mssImage string
outputDir string
)
var fusCmd = &cobra.Command{
Use: "fus",
Short: "use GDAL_Pansharpen to merge PAN and MSS images",
Run: func(cmd *cobra.Command, args []string) {
fusedTiff := filepath.Base(mssImage)
fusedTiff = strings.Replace(fusedTiff, "MSS", "FUS", -1)
err := producer.GDALPansharpen(panImage, mssImage, filepath.Join(outputDir, fusedTiff))
if err != nil {
logrus.Fatal(err)
}
},
}
func init() {
rootCmd.AddCommand(fusCmd)
fusCmd.Flags().StringVarP(&panImage, "pan", "p", "", "path to the PAN image")
fusCmd.Flags().StringVarP(&mssImage, "mss", "m", "", "path to the MSS image")
fusCmd.Flags().StringVarP(&outputDir, "output", "o", "", "path to the output directory")
fusCmd.Flags().StringVarP(&paramsXML, "params", "x", "", "path to the XML file containing parameters for GDAL_Pansharpen")
}