Esempio n. 1
0
File: gdal.go Progetto: kikht/gdal
// Open a shared existing dataset
func OpenShared(filename string, access Access) Dataset {
	cFilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cFilename))

	dataset := C.GDALOpenShared(cFilename, C.GDALAccess(access))
	return Dataset{dataset}
}
Esempio n. 2
0
File: gdal.go Progetto: kikht/gdal
// Open an existing dataset
func Open(filename string, access Access) (Dataset, error) {
	cFilename := C.CString(filename)
	defer C.free(unsafe.Pointer(cFilename))

	dataset := C.GDALOpen(cFilename, C.GDALAccess(access))
	if dataset == nil {
		return Dataset{nil}, fmt.Errorf("Error: dataset '%s' open error", filename)
	}
	return Dataset{dataset}, nil
}