示例#1
0
文件: gdal.go 项目: colek42/gdal
func (object *Dataset) SetMetadataItem(name, value, domain string) error {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))

	c_value := C.CString(value)
	defer C.free(unsafe.Pointer(c_value))

	c_domain := C.CString(domain)
	defer C.free(unsafe.Pointer(c_domain))

	return C.GDALSetMetadataItem(
		C.GDALMajorObjectH(unsafe.Pointer(object.cval)),
		c_name, c_value, c_domain,
	).Err()
}
示例#2
0
文件: gdal.go 项目: kikht/gdal
func setMetadataItem(object unsafe.Pointer, name, value, domain string) error {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))

	c_value := C.CString(value)
	defer C.free(unsafe.Pointer(c_value))

	c_domain := C.CString(domain)
	defer C.free(unsafe.Pointer(c_domain))

	err := C.GDALSetMetadataItem((C.GDALMajorObjectH)(object), c_name, c_value, c_domain)
	if err != 0 {
		return error(err)
	}

	return nil
}