rastertodataframe.rastertodataframe module

rastertodataframe.rastertodataframe.raster_to_dataframe(raster_path, vector_path=None)[source]

Convert a raster to a Pandas DataFrame.

Parameters:
  • raster_path (str) – Path to raster file.
  • vector_path (str) – Optional path to vector file. If given, raster pixels will be extracted from features in the vector. If None, all raster pixels are converted to a DataFrame.
Returns:

Return type:

pandas.core.frame.DataFrame