예제 #1
0
파일: gdal.go 프로젝트: colek42/gdal
// Fetch single metadata item.
func (object *Driver) MetadataItem(name, domain string) string {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))

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

	return C.GoString(
		C.GDALGetMetadataItem(
			C.GDALMajorObjectH(unsafe.Pointer(object.cval)),
			c_name, c_domain,
		),
	)
}
예제 #2
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()
}