示例#1
0
文件: ogr.go 项目: renderless/imposm3
func Open(name string) (*DataSource, error) {
	namec := C.CString(name)
	defer C.free(unsafe.Pointer(namec))
	ds := C.OGROpen(namec, 0, nil)
	if ds == nil {
		return nil, lastOgrError("failed to open")
	}
	return &DataSource{ds}, nil
}
示例#2
0
文件: ogr.go 项目: colek42/gdal
// Open a file / data source with one of the registered drivers
func OpenDataSource(name string, update int) DataSource {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	ds := C.OGROpen(cName, C.int(update), nil)
	return DataSource{ds}
}