fmeobjects.FMERasterTools.clipGeometry

FMERasterTools.clipGeometry(clippers, candidate, parms)

Clips a raster with a set of clipper geometries.

Parameters:
  • clippers (FMEAggregate) – The clippers must be areas.

  • candidate (FMERaster) – The raster to clip.

  • parms (dict[str, str]) – (Optional) Name-value pair representing additional parameters.

Possible parms are :

kFME_Clip_cellGeometry

  • center or boundary. (Default is center)

  • Specifies how each cell is represented when tested against clippers. If set to center, then each cell is represented by its center point. That is, if the center point of a cell is inside a clipper, that cell is considered to be inside. If set to boundary, then the cell boundary (i.e. the entire cell) is considered. That is, a cell is only considered to be inside when the entire cell is inside a clipper.

kFME_clip_treatBoundaryAsInside

  • Yes or No. (Default is No)

  • Specifies whether to consider cells where the center point falls on the clipper boundary as inside. Only applicable when the cell geometry is center.

kFME_clip_treatBoundaryAsOutside

  • Yes or No. (Default is No)

  • Specifies whether to consider cells where the center point falls on the clipper boundary as outside. Only applicable when the cell geometry is center.

kFME_clip_createOutside

  • Yes or No. (Default is No)

  • Specifies whether to create an additional raster containing the outside cells. That is, if this option is yes, the output aggregate will contain (numClippers+1) geometries, where the last one contains the cells that are not contained by any of the clippers. Specifying no may improve performance.

kFME_Clip_preserveExtents

  • Yes or No (Default is No)

  • Specifies whether to preserve the extents of the input raster. If No, then each raster will be reduced to the inside area. If Yes, the raster’s extents will not be modified, and areas outside the specified clip extents but within the input raster’s extents will be filled with nodata.

kFME_Clip_addNodata

  • Yes or No. (Default is No)

  • Specifies whether nodata should be added (by introducing an alpha band for RGB rasters, or adding a palette entry for bands with palettes) when “empty” areas are being introduced in a raster (e.g. for a non-rectangular clipper, or for the outside raster).

kFME_Clip_clippedTraitName

  • Specifies the name of a trait that will be set on each output part, specifying whether that part was clipped or not. That is, the trait will be set to true if the geometry is a subset of the input raster, or false if the geometry is identical to the input raster.

Return type:

FMEAggregate

Returns:

An aggregate containing a raster or null geometry for each clipper, depending on whether the clipper intersects the raster.

Raises:

FMEException – An exception is raised if an error occurred.