def to_pandas(raster, name='<STR_LIT:value>'):
df = pd.DataFrame(raster.raster)<EOL>df = df.stack()<EOL>df = df.reset_index()<EOL>df.columns = ['<STR_LIT>', '<STR_LIT>', name]<EOL>df['<STR_LIT:x>'] = df.col.apply(lambda col: raster.geot[<NUM_LIT:0>]+(col)*raster.geot[<NUM_LIT:1>])<EOL>df['<STR_LIT:y>'] = df.row.apply(lambda row: raster.geot[<NUM_LIT:3>]+(row)*raster.geot[-<NUM_LIT:1>])<EOL>return df<EOL>
Convert GeoRaster to Pandas DataFrame, which can be easily exported to other types of files
The DataFrame has the row, col, value, x, and y values for each cell
Usage:
    df = gr.to_pandas(raster)