geoanalytics.extensions.RTDataFrameAccessor

plot

geoanalytics.extensions.RTDataFrameAccessor.plot(self, raster_field=None, band_ids=1, ax=None, figsize=None, cmap=None, vmin=None, vmax=None, basemap=None, sr=None, extent=None, alpha=None, zorder=None, resample=True, show_axis=False)

Plot a raster column from a PySpark DataFrame.

Parameters:
  • raster_field (str, optional) – Name of the raster field to plot.

  • band_ids ((int, list), optional) – Ids of the raster bands to plot. This can be a single band or a list of 3 (RGB) or 4 (RGBA) bands. Default is 1.

  • ax (matplotlib.axes.Axes, optional) – The axes on which to plot. By default new axes are created.

  • figsize ((float, float), optional) – Tuple representing the width and height of the resulting matplotlib.figure.Figure in inches. This parameter is ignored when the ax parameter is set.

  • cmap (str, optional) – Name of the matplotlib colormap to use.

  • vmin (float, optional) – Cmap minimum value.

  • vmax (float, optional) – Cmap maximum value.

  • basemap (str, optional) – Adds a basemap to the plot. Choose from “light” (Light Gray Canvas), “dark” (Dark Gray Canvas), “streets” (Esri Streets Basemap) or “osm” (OpenStreetMap Vector Basemap). Basemap labels are not supported.

  • sr (SpatialReference, optional) – The spatial reference of the resulting plot, specified using a SRID, WKT string, or SpatialReference object. If the raster is in a different spatial reference, it will be transformed.

  • extent (BoundingBox, optional) – Sets the extent for plotting rasters. Only the raster cells that intersect the extent will be visible in the plot.

  • alpha (float, optional) – Controls the transparency of the raster.

  • zorder (float, optional) – Sets the drawing order when multiple raster and/or geometry columns are plotted on the same axes.

  • resample (bool, optional) – If set to False, it will not resample the plot. The default is True.

  • show_axis (bool, optional) – If True, show the x-axis, y-axis and frame. If False, hide the the x-axis, y-axis and frame. The default is False.

Returns:

Matplotlib axes

Return type:

matplotlib.axes.Axes