Skip to content

Commit

Permalink
Merge pull request lukeroth#73 from bayuemu/patch-4
Browse files Browse the repository at this point in the history
Update utilities.go
  • Loading branch information
martende authored Nov 1, 2021
2 parents 0ed96ec + 62421ae commit c3802da
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@ func stringArrayContains(array []string, needle string) bool {
return false
}

func Info(sourceDS Dataset, options []string) string {

length := len(options)
opts := make([]*C.char, length+1)
for i := 0; i < length; i++ {
opts[i] = C.CString(options[i])
defer C.free(unsafe.Pointer(opts[i]))
}
opts[length] = (*C.char)(unsafe.Pointer(nil))
infoOpts := C.GDALInfoOptionsNew(
(**C.char)(unsafe.Pointer(&opts[0])),
(*C.GDALInfoOptionsForBinary)(unsafe.Pointer(nil)))
defer C.GDALInfoOptionsFree(infoOpts)

infoText := C.GDALInfo(
sourceDS.cval,
infoOpts,
)

return C.GoString(infoText)

}

func BuildVRT(dstDS string, sourceDS []Dataset, srcDSFilePath, options []string) (Dataset, error) {
if dstDS == "" {
dstDS = "MEM:::"
Expand Down

0 comments on commit c3802da

Please sign in to comment.