Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func Info(sourceDS Dataset, options []string) string {
}

func BuildVRT(dstDS string, sourceDS []Dataset, srcDSFilePath, options []string) (Dataset, error) {
if len(sourceDS) == 0 {
return Dataset{}, fmt.Errorf("BuildVRT: sourceDS must not be empty")
}
if dstDS == "" {
dstDS = "MEM:::"
if !stringArrayContains(options, "-of") {
Expand Down Expand Up @@ -103,6 +106,9 @@ func BuildVRT(dstDS string, sourceDS []Dataset, srcDSFilePath, options []string)
}

func Warp(dstDS string, destDS *Dataset, sourceDS []Dataset, options []string) (Dataset, error) {
if len(sourceDS) == 0 {
return Dataset{}, fmt.Errorf("Warp: sourceDS must not be empty")
}
if dstDS == "" && destDS == nil {
dstDS = "MEM:::"
if !stringArrayContains(options, "-of") {
Expand Down Expand Up @@ -176,6 +182,9 @@ func Translate(dstDS string, sourceDS Dataset, options []string) (Dataset, error
}

func VectorTranslate(dstDS string, sourceDS []Dataset, options []string) (Dataset, error) {
if len(sourceDS) == 0 {
return Dataset{}, fmt.Errorf("VectorTranslate: sourceDS must not be empty")
}
if dstDS == "" {
dstDS = "MEM:::"
if !stringArrayContains(options, "-f") {
Expand Down