FUS L2
This commit is contained in:
@@ -16,10 +16,21 @@ import (
|
||||
// gdalwarp -rpc -to "RPC_DEM=/path/to/dem/gdlebm.tif" in.tif out.tif
|
||||
|
||||
func L1AtoL2(in, out, meta, rpb, demtif string) error {
|
||||
meta, _ = filepath.Abs(meta)
|
||||
m, err := ParseProductMeta(meta)
|
||||
if err != nil {
|
||||
return err
|
||||
var m *ProductMeta
|
||||
var err error
|
||||
|
||||
sensor := "MSS"
|
||||
reverse := true
|
||||
if meta == "" {
|
||||
sensor = "FUS"
|
||||
reverse = true
|
||||
m = &ProductMeta{}
|
||||
} else {
|
||||
meta, _ = filepath.Abs(meta)
|
||||
m, err = ParseProductMeta(meta)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
in, _ = filepath.Abs(in)
|
||||
@@ -45,9 +56,12 @@ func L1AtoL2(in, out, meta, rpb, demtif string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
sensor := "MSS"
|
||||
if strings.Contains(m.ProductID, "PAN") {
|
||||
sensor = "PAN"
|
||||
reverse = false
|
||||
} else if strings.Contains(m.ProductID, "FUS") {
|
||||
sensor = "FUS"
|
||||
reverse = false
|
||||
}
|
||||
|
||||
corners, width, height, err := computeBound(out)
|
||||
@@ -65,7 +79,7 @@ func L1AtoL2(in, out, meta, rpb, demtif string) error {
|
||||
xmlfile := filepath.Join(dir, id+".meta.xml")
|
||||
writeProductMeta(m, xmlfile)
|
||||
|
||||
GTiffToJPG(out, strings.Replace(out, ".tiff", ".jpg", 1), sensor, false)
|
||||
GTiffToJPG(out, strings.Replace(out, ".tiff", ".jpg", 1), sensor, reverse)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user