// 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 }
// Fetch column index for indicated usage func (rat RasterAttributeTable) ColOfUsage(rfu RATFieldUsage) int { index := C.GDALRATGetColOfUsage(rat.cval, C.GDALRATFieldUsage(rfu)) return int(index) }