Ejemplo n.º 1
0
Archivo: gdal.go Proyecto: kikht/gdal
// Build raster overview(s)
func (dataset Dataset) BuildOverviews(
	resampling string,
	nOverviews int,
	overviewList []int,
	nBands int,
	bandList []int,
	progress ProgressFunc,
	data interface{},
) error {
	cResampling := C.CString(resampling)
	defer C.free(unsafe.Pointer(cResampling))

	arg := &goGDALProgressFuncProxyArgs{progress, data}

	err := C.GDALBuildOverviews(
		dataset.cval,
		cResampling,
		C.int(nOverviews),
		(*C.int)(unsafe.Pointer(&overviewList[0])),
		C.int(nBands),
		(*C.int)(unsafe.Pointer(&bandList[0])),
		C.goGDALProgressFuncProxyB(),
		unsafe.Pointer(arg),
	)
	if err != 0 {
		return error(err)
	}

	return nil
}
Ejemplo n.º 2
0
Archivo: gdal.go Proyecto: colek42/gdal
// Build raster overview(s)
func (dataset Dataset) BuildOverviews(
	resampling string,
	nOverviews int,
	overviewList []int,
	nBands int,
	bandList []int,
	progress ProgressFunc,
	data interface{},
) error {
	cResampling := C.CString(resampling)
	defer C.free(unsafe.Pointer(cResampling))

	arg := &goGDALProgressFuncProxyArgs{progress, data}

	return C.GDALBuildOverviews(
		dataset.cval,
		cResampling,
		C.int(nOverviews),
		(*C.int)(unsafe.Pointer(&IntSliceToCInt(overviewList)[0])),
		C.int(nBands),
		(*C.int)(unsafe.Pointer(&IntSliceToCInt(bandList)[0])),
		C.goGDALProgressFuncProxyB(),
		unsafe.Pointer(arg),
	).Err()
}