暂时使用星下点坐标作为图像左上角坐标
This commit is contained in:
38
cmd/fus.go
Normal file
38
cmd/fus.go
Normal 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(¶msXML, "params", "x", "", "path to the XML file containing parameters for GDAL_Pansharpen")
|
||||
}
|
||||
Reference in New Issue
Block a user