geepillow.eeblocks#

Block for Google Earth Engine images and image collections.

Attributes#

Classes#

EEImageBlock

EEImageBlock.

EEImageCollectionGrid

A grid for image collections.

Module Contents#

class geepillow.eeblocks.EEImageBlock(ee_image, viz_params=None, dimensions=Block.DEFAULT_SIZE, scale=None, region=None, overlay=None, overlay_style=None, style_property=None, position='center-center', fit_block=True, keep_proportion=True, size=None, background_color='white', background_opacity=1, mode=DEFAULT_MODE)[source]#

Bases: geepillow.blocks.ImageBlock

EEImageBlock.

By default, the size of the image matches the size of the block.

Parameters:
  • ee_image (ee.Image) – Earth Engine image.

  • viz_params (dict | None) – Visualization parameters.

  • dimensions (tuple | int) – dimensions of the image, in pixels. If only one number is passed, it is used as the maximum, and the other dimension is computed by proportional scaling.

  • scale (int | None) – spatial resolution.

  • region (ee.Geometry | ee.Feature | None) – region of interest to “clip” the image to.

  • overlay (ee.FeatureCollection | ee.Feature | ee.Geometry | None) – a feature collection to overlay on top of the image.

  • overlay_style (dict | None) – style of the overlay.

  • style_property (str | None) – A per-feature property expected to contain a dictionary. Values in the dictionary override any default values for that feature.

  • position (tuple | geepillow.blocks.PositionType) – position of the image inside the block.

  • fit_block (bool) – if True the element’s boundaries will never exceed the block.

  • keep_proportion (bool) – keep proportion (ratio) of the image.

  • size (tuple | None) – size of the block (not the image). If None it will be taken from the dimensions of the image.

  • background_color (str | geepillow.colors.Color) – color of the background.

  • background_opacity (float) – opacity of the background.

  • mode (str) – mode of the background image

dimensions = (500, 500)[source]#
ee_image[source]#
overlay = None[source]#
overlay_style = None[source]#
region = None[source]#
scale = None[source]#
style_property = None[source]#
viz_params[source]#
class geepillow.eeblocks.EEImageCollectionGrid(collection, viz_params=None, scale=None, region=None, text_pattern=None, text_position='bottom', font=DEFAULT_GRID_FONT, overlay=None, overlay_style=None, style_property=None, x_space=10, y_space=10, n_columns=None, n_rows=None, image_dimensions=None, dimensions=(3300, 2250), image_position='center-center', text_inner_position='center-center', position='center-center', fit_block=True, keep_proportion=True, size=None, background_color='white', background_opacity=1, mode=DEFAULT_MODE)[source]#

Bases: geepillow.grids.Grid

A grid for image collections.

This class is designed for Image Collection with overlapping images.

If n_columns is not None and n_rows is None, the number of rows will be computed using the number of images. Same the other way around. If both are None, n_columns will be set to 3.

Parameters:
  • collection (ee.ImageCollection) – Earth Engine image collection.

  • n_columns (int | None) – number of columns.

  • n_rows (int | None) – number of rows.

  • viz_params (dict | None) – Visualization parameters.

  • scale (int | None) – spatial resolution.

  • text_pattern (str | None) – A text pattern to include in the position indicated by text_position param. Properties of the image can be used inside this text following this guide: https://geetools.readthedocs.io/en/stable/autoapi/geetools/ee_string/StringAccessor.format.html

  • text_position (TextPositionType) – the position of the text block.

  • font (str | geepillow.blocks.FontType) – font to use. The size the font is included in this parameter.

  • region (ee.Geometry | ee.Feature | None) – region of interest to “clip” each image to. If None it uses the geometry of each image.

  • overlay (ee.FeatureCollection | ee.Feature | ee.Geometry | None) – a feature collection to overlay on top of the image.

  • overlay_style (dict | None) – style of the overlay.

  • style_property (str | None) – A per-feature property expected to contain a dictionary. Values in the dictionary override any default values for that feature.

  • image_dimensions (tuple | int | None) – dimensions of the image, in pixels. If only one number is passed, it is used as the maximum, and the other dimension is computed by proportional scaling.

  • dimensions (tuple) – dimensions of the grid image in pixels. The default value corresponds to the size of a Letter at 300 DPI (landscape orientation).

  • image_position (tuple | geepillow.blocks.PositionType) – position of the image inside its block.

  • text_inner_position (tuple | geepillow.blocks.PositionType) – position of the text inside its block.

  • position (tuple | geepillow.blocks.PositionType) – position of the grid inside its block.

  • fit_block (bool) – if True the element’s boundaries will never exceed the block.

  • keep_proportion (bool) – keep proportion (ratio) of the image.

  • size (tuple | None) – size of the block (not the image).

  • background_color (str | geepillow.colors.Color) – color of the background.

  • background_opacity (float) – opacity of the background.

  • mode (str) – mode of the background image

  • x_space (int) – space on the x axis.

  • y_space (int) – space on the y axis.

make_blocks()[source]#

Make the list of blocks for the grid.

Return type:

list[list[geepillow.blocks.Block]]

make_image_block(image)[source]#

Make the block for the image and text block if needed.

Parameters:

image (ee.Image)

Return type:

geepillow.blocks.Block

_image_dimensions = None[source]#
_image_ids = None[source]#
_n_columns = None[source]#
_n_rows = None[source]#
collection[source]#
dimensions = (3300, 2250)[source]#
font[source]#
property image_dimensions[source]#

Dimensions of each image.

property image_ids[source]#

Ids of all the images in the collection.

image_position = 'center-center'[source]#
property n_columns: int[source]#

Number of columns.

Return type:

int

property n_last: int[source]#

Number of elements in the last row.

Return type:

int

property n_rows[source]#

Number of rows.

overlay = None[source]#
overlay_style = None[source]#
region = None[source]#
scale = None[source]#
style_property = None[source]#
text_inner_position = 'center-center'[source]#
text_pattern = None[source]#
text_position = 'bottom'[source]#
viz_params[source]#
x_space = 10[source]#
y_space = 10[source]#
geepillow.eeblocks.DEFAULT_GRID_FONT[source]#
geepillow.eeblocks.TextPositionType[source]#
geepillow.eeblocks.logger[source]#