示例#1
0
文件: gdal.go 项目: kikht/gdal
// Create new column
func (rat RasterAttributeTable) CreateColumn(name string, rft RATFieldType, rfu RATFieldUsage) error {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	err := C.GDALRATCreateColumn(rat.cval, cName, C.GDALRATFieldType(rft), C.GDALRATFieldUsage(rfu))
	if err != 0 {
		return error(err)
	}

	return nil
}
示例#2
0
文件: gdal.go 项目: kikht/gdal
// Fetch column index for indicated usage
func (rat RasterAttributeTable) ColOfUsage(rfu RATFieldUsage) int {
	index := C.GDALRATGetColOfUsage(rat.cval, C.GDALRATFieldUsage(rfu))
	return int(index)
}