Module fmeobjects :: Class FMEFeature
[hide private]
[frames] | no frames]

Class FMEFeature


init(MultipleInvocations)

FME Feature class.

Create an instance of a feature which is used throughout the system to contain both geometric and attribute data.

init()

Default FMEFeature constructor.

Returns: FMEFeature

init(feature)

Create a copy of the passed in Feature object.

Parameters

Returns: FMEFeature

Instance Methods [hide private]
 
__decIterRef__(args)
 
__getObject__(args)
 
__incIterRef__(args)
 
__init__(MultipleInvocations)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__iter__(x)
iter(x)
a new object with type S, a subtype of T
__new__(T, S, ...)
None
addCoordinate(x, y, z=0.0)
Adds a coordinate onto the feature.
None
addCoordinates(coordinates)
Adds coordinates onto the feature.
((float, float), (float, float))
boundingBox()
Return the bounding box of the feature.
((float, float, float), (float, float, float))
boundingCube()
Return the bounding cube of the feature.
None
buffer(width, sampleAngle)
This method generates a buffer around the feature.
None
buildAggregateFeat(featureList)
Create an aggregate feature from the supplied list of features.
None
changeCase(changeOpt, matchExp, caseType)
Change the letter case of attribute names and values.
bool
chopUp(vertexThreshold)
Convert a feature into an aggregate, if it contains more than the threshold of vertices, where each member of the aggregate has fewer than the threshold number of vertices.
FMEFeature
clone()
Create a new FMEFeature as a clone of this one.
FMEFeature
cloneAttributes()
Create a new FMEFeature with only the attributes of this one copied over.
None
convertAnyArcToPoints(center, semiPrimaryAxis, semiSecondaryAxis, origNumSamps, startAngle, sweepAngle, rotation)
Strokes an arc feature to be a polygon or line.
None
convertArcToPointUseAttributes()
Strokes an arc feature to be a polygon or line.
None
convertArcToPoints(center, semiPrimaryAxis, semiSecondaryAxis, origNumSamps, startAngle, endAngle, rotation)
Strokes an arc feature to be a polygon or line.
None
convertPointsToArc(radiusAttrName, startAngleAttrName, sweepAngleAttrName)
Converts the feature into a point feature with attributes required to define it as an arc.
bool
deserialize(buffer, parameters)
Restore the state of the FMEFeature from the specified buffer.
bytearray Python 2.7, bytes Python 3, or None
exportGeometryToOGCWKB(version)
Convert the geometry of the feature to the OGC Well Known Binary format.
string
exportGeometryToOGCWKT(version)
Convert the geometry of the feature to the OGC Well Known Text format.
tuple
generatePointInPolygon(pretty)
Generate a point somewhere inside the polygon.
list of strings
getAllAttributeNames()
This method returns a complete, exhaustive list of all the attribute names present in the feature.
list
getAllCoordinates()
Get all the coordinates in this feature.
bool, int, long, float, string, list of strings, unicode Python 2.7 only, list of unicodes Python 2.7 only, bytearray Python 2.7 only, list of bytearrays Python 2.7 only, bytes Python 3 only, list of bytes Python 3 only, or None
getAttribute(attrName)
Get the value of the named attribute.
tuple of bool bool and int
getAttributeNullMissingAndType(attributeName)
This method returns a tuple of a boolean, indicating if the attribute is null, a boolean indicating if the attribute is missing and an integer representing the type of the attribute.
int
getAttributeType(attrName)
Get the type of the named attribute.
string
getCoordSys()
Get the Coordinate System of the feature.
tuple of floats
getCoordinate(index)
Access the feature's individual coordinates by index.
int
getDimension()
Get the dimension of the feature.
list of FMEFeatures
getDonutParts()
Break a donut feature into its constituent parts.
string
getFeatureType()
Get the Feature Type of the feature.
FMEGeometry of a terminal type
getGeometry()
Get the feature's geometry.
int
getGeometryType()
Get the feature's classic geometry type.
list of strings
getSequencedAttributeNames()
This method gets a list of sequenced attribute names in the order they were added to the feature.
bool
hasGeometry()
Returns: True if the feature has a geometry and False otherwise.
bool
hasRichGeometry()
Returns: True if the feature's geometry takes advantage of the new geometry technology, and False otherwise.
None
importGeometryFromOGCWKB(ogcwkb)
Set the geometry of the feature to be that specified in the OGC Well Known Binary format.
None
importGeometryFromOGCWKT(ogcwkt)
Set the geometry of the feature to be that specified in the OGC Well Known Text format.
None
interpolateSpline(numPointsPerSegment, calcPhantomPoints)
Perform interpolation on the feature.
None
makeDonuts(featureList)
Construct a donut polygon from the list of features provided.
None
matrixTransform(matrix)
Perform a 2D or 3D matrix transformation on the feature.
None
mergeAttributes(destFeature)
Set the featureType and attributes of the feature passed in from the current feature, but ONLY if those attributes are not already present.
int
numCoords()
Get the number of coordinates in the feature.
int
numParts(flatten, splitDonuts)
Get the number of parts that make up the geometry of the feature.
int
numVertices()
Get the number of vertices that make up the geometry of the feature Multi-part (aggregate) geometries are handled properly.
None
offset(x, y, z)
Offsets the feature by the given amounts.
int
orient(rule)
Optionally set and get the orientation rule of the feature.
None
outerShell()
Set the geometry of the feature to be just its outer shell.
string
performFunction(functionSpecification)
Call any FME function on the feature.
None
processFeatures(featureList, paramList)
Perform some general processing operation on a list of features.
None
removeAttribute(attrName)
Remove the named attribute if it exists.
None
removeAttrsWithPrefix(attrPrefix)
Remove all attributes with the specified prefix.
FMEGeometry of a terminal type
removeGeometry()
Remove and return the feature's geometry.
None
removeTraits(regexp)
None
reproject(coordSys)
Reproject the feature from its current coordinate system to that specified.
None
resetCoords()
Reset the number of coordinates in the feature to 0.
None
resetFeature()
Reset (clear) all the attributes and geometry of the feature.
None
rotate2D(origin, angle)
Rotate the feature counterclockwise around the origin point by the specified angle (in degrees)
None
scale(x, y, z)
Scale the feature by the given amounts.
bytearray Python 2.7, bytes Python 3, or None
serialize(parameters)
Write the state of the FMEFeature to a string buffer.
None
setAttribute(attrName, attrValue)
Supply a new attribute for the feature.
none
setAttributeNullWithType(attributeName, attributeType)
This method supplies a null attribute with a type to the feature.
None
setCoordSys(coordSys)
Set the Coordinate System of the feature.
None
setDimension(dimension)
Set the dimension of the feature.
None
setFeatureType(featureType)
This method sets the feature type of the FME Feature.
None
setGeometry(geometry)
Set the feature's geometry.
None
setGeometryType(geomType)
Set the feature's classic geometry type.
None
setSequencedAttribute(attrName, attrValue)
Supply a new attribute for the feature, but in such a way that the sequence is remembered.
list of FMEFeature
splitAggregate(recurse)
Split up an aggregate feature into pieces, all of which have the same attributes and feature type.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(MultipleInvocations)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

addCoordinate(x, y, z=0.0)

 

Adds a coordinate onto the feature. Missing values are replaced by 0.

If the feature is two-dimensional, any provided third coordinate is ignored.

Parameters:
  • x (float) - The x coordinate to add.
  • y (float) - The y coordinate to add.
  • z (float) - (Optional) The z coordinate to add: Default value = 0.0
Returns: None

addCoordinates(coordinates)

 

Adds coordinates onto the feature. Missing values are replaced by 0.

If the feature is two-dimensional, any provided third coordinate is ignored.

Parameters:
  • coordinates (list of tuple of floats) - The list of coordinates to add.
Returns: None

boundingBox()

 

Return the bounding box of the feature.

Returns: ((float, float), (float, float))
The bounding box of the feature.
Raises:
  • FMEException - An exception is raised if an error occurred.

boundingCube()

 

Return the bounding cube of the feature.

Returns: ((float, float, float), (float, float, float))
The bounding cube of the feature.
Raises:
  • FMEException - An exception is raised if an error occurred.

buffer(width, sampleAngle)

 

This method generates a buffer around the feature. The features geometry is replaced by the new buffer geometry. If the feature is an area feature then the buffer is only generated on the outside (and inside holes) of the feature.

Parameters:
  • width (float) - The number of ground units to buffer around the feature.
  • sampleAngle (float) - The sampling angle. If 5 then there is a vertex on the buffer every 5 degrees.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

buildAggregateFeat(featureList)

 

Create an aggregate feature from the supplied list of features.

Parameters:
  • featureList (list of FMEFeatures) - The list of features to build the aggregate from.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

changeCase(changeOpt, matchExp, caseType)

 

Change the letter case of attribute names and values.

Parameters:
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

chopUp(vertexThreshold)

 

Convert a feature into an aggregate, if it contains more than the threshold of vertices, where each member of the aggregate has fewer than the threshold number of vertices.

If the feature was an area based feature, it will do area chopping, subdividing the area so that no area piece has more than the number of vertices.

If the feature was linear, then the line is broken into chunks that meet the size criteria.

Parameters:
  • vertexThreshold (int) - The threshold number of vertices.
Returns: bool
True if the feature was chopped, False otherwise.
Raises:
  • FMEException - An exception is raised if an error occurred.

clone()

 

Create a new FMEFeature as a clone of this one.

Returns: FMEFeature
A clone of the original feature.
Raises:
  • FMEException - An exception is raised if an error occurred.
  • FMEException - An exception is raised if an error occurred.

cloneAttributes()

 

Create a new FMEFeature with only the attributes of this one copied over.

Returns: FMEFeature
A FMEFeature with only the attributes of the original FMEFeature copied over.
Raises:
  • FMEException - An exception is raised if an error occurred.

convertAnyArcToPoints(center, semiPrimaryAxis, semiSecondaryAxis, origNumSamps, startAngle, sweepAngle, rotation)

 

Strokes an arc feature to be a polygon or line.

Parameters:
  • center ((float, float)) - The center coordinate.
  • semiPrimaryAxis (float) - The semi-primary axis.
  • semiSecondaryAxis (float) - The semi-secondary axis.
  • origNumSamps (int) - The original number of samples.
  • startAngle (float) - The start angle.
  • sweepAngle (float) - The sweep angle.
  • rotation (float) - The amount of rotation.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

convertArcToPointUseAttributes()

 

Strokes an arc feature to be a polygon or line. The parameters used to stroke the arc or ellipse are retrieved from the related attributes. Arcs with a sweep angle of 360 degrees will be converted into a polygon.

Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

convertArcToPoints(center, semiPrimaryAxis, semiSecondaryAxis, origNumSamps, startAngle, endAngle, rotation)

 

Strokes an arc feature to be a polygon or line.

Parameters:
  • center ((float, float)) - The center coordinate.
  • semiPrimaryAxis (float) - The semi-primary axis.
  • semiSecondaryAxis (float) - The semi-secondary axis.
  • origNumSamps (int) - The original number of samples.
  • startAngle (float) - The start angle.
  • endAngle (float) - The end angle.
  • rotation (float) - The amount of rotation.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

convertPointsToArc(radiusAttrName, startAngleAttrName, sweepAngleAttrName)

 

Converts the feature into a point feature with attributes required to define it as an arc. If the feature has more than 3 points, the arc is approximated.

Parameters:
  • radiusAttrName (string) - The name of the radius attribute.
  • startAngleAttrName (string) - The name of the start angle attribute.
  • sweepAngleAttrName (string) - The name of the sweep angle attribute.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

deserialize(buffer, parameters)

 

Restore the state of the FMEFeature from the specified buffer.

Parameters:
  • buffer (bytearray Python 2.7, bytes Python 3) - The buffer from which the state of the feature is restored from.
  • parameters (dict) - (Optional) Possible name-value pairs are:

    'fme_feature_deserialize_option'

    • 'fme_feature_deserialize_reset': (Default) Reset the original feature before restoring the state of the FMEFeature.
    • 'fme_feature_deserialize_merge': When restoring the state of the FMEFeature, the original feature will NOT be reset; the original information in the feature will be preserved when there is no corresponding information in the buffer. Attributes, geometry, coordinate system information, etc. taken from the buffer will overwrite such information on the feature if necessary.

    'fme_feature_deserialize_sidecar_basename'

    • File from which to read extra geometry data: The path and basename (not including file extension) from which additional data will be read for some geometries (raster, point cloud). If this option is not specified for those geometries, they may return an error when data is requested (e.g. when writing out a raster).
Returns: bool
True on success, False otherwise.

exportGeometryToOGCWKB(version)

 

Convert the geometry of the feature to the OGC Well Known Binary format.

Parameters:
Returns: bytearray Python 2.7, bytes Python 3, or None
A buffer representing the geometry of the feature converted to the OGCWKB.
Raises:
  • FMEException - An exception is raised if an error occurred.

exportGeometryToOGCWKT(version)

 

Convert the geometry of the feature to the OGC Well Known Text format.

Parameters:
Returns: string
A string representing the geometry of the feature converted to the OGCWKT.
Raises:
  • FMEException - An exception is raised if an error occurred.

generatePointInPolygon(pretty)

 

Generate a point somewhere inside the polygon. If the feature is 3D, the Z value is calculated to be the average of all points on the feature.

Parameters:
  • pretty (bool) - (Optional) Generate a point that has a more central position, however more computational time may be required. Default: False
Returns: tuple
A point somewhere inside the polygon.
Raises:
  • FMEException - An exception is raised if an error occurred.

getAllAttributeNames()

 

This method returns a complete, exhaustive list of all the attribute names present in the feature.

Returns: list of strings
A list of all the attribute names present in the feature.

getAllCoordinates()

 

Get all the coordinates in this feature. Returns a list of coordinates, each as a tuple of floats.

Returns: list
A list of coordinates in the feature.

getAttribute(attrName)

 

Get the value of the named attribute. Strings are returned as one of two possible types - system encoded strings or unicode strings, if the source attribute was encoded. Null attribute values will be returned as an empty string. Binary blob attributes are returned as a bytearray.

For list attributes, an example list name could be "adjacentIds", which would return a list of all the values found for "adjacentIds{0} ... adjacentIds{N}". The function also accepts a "structured list" specification, such as "attrInfo{}.name", which would return a list of all the values found for "attrInfo{0}.name ... attrInfo{N}.name".

In cases where there is ambiguity between retrieving an attribute value and a list attribute, the attrName should be appended with "{}" in order to retrieve the list (i.e. the attrName "fme_type" should be "fme_type{}").

A return of None indicates the attribute or list attribute does not exist.

Parameters:
  • attrName (string) - The name of the attribute to get on the feature.
Returns: bool, int, long, float, string, list of strings, unicode Python 2.7 only, list of unicodes Python 2.7 only, bytearray Python 2.7 only, list of bytearrays Python 2.7 only, bytes Python 3 only, list of bytes Python 3 only, or None
The value of the named attribute.
Raises:
  • FMEException - An exception is raised if there was a problem in retrieving the attribute value.

getAttributeNullMissingAndType(attributeName)

 

This method returns a tuple of a boolean, indicating if the attribute is null, a boolean indicating if the attribute is missing and an integer representing the type of the attribute. The first boolean is True if attributeName maps to a null attribute value on the feature. Otherwise it is False. The second boolean is True if attributeName maps to no value on the feature. Otherwise it is False. If the attribute is absent FME_ATTR_UNDEFINED is returned for the type, otherwise the attribute type is returned.

The possible attribute types are FME_ATTR_UNDEFINED, FME_ATTR_BOOLEAN, FME_ATTR_INT8, FME_ATTR_UINT8, FME_ATTR_INT16, FME_ATTR_UINT16, FME_ATTR_INT32, FME_ATTR_UINT32, FME_ATTR_REAL32, FME_ATTR_REAL64, FME_ATTR_REAL80, FME_ATTR_STRING, FME_ATTR_ENCODED_STRING, FME_ATTR_INT64, FME_ATTR_UINT64.

Parameters:
  • attributeName (string) - The name of the attribute.
Returns: tuple of bool bool and int
A tuple of 2 boolean values, the first indicating whether or not the value of the attribute is null, the second whether or not the attribute is missing and an integer representing the attribute type.

getAttributeType(attrName)

 

Get the type of the named attribute.

Returns one of FME_ATTR_UNDEFINED, FME_ATTR_BOOLEAN, FME_ATTR_INT8, FME_ATTR_UINT8, FME_ATTR_INT16, FME_ATTR_UINT16, FME_ATTR_INT32, FME_ATTR_UINT32, FME_ATTR_REAL32, FME_ATTR_REAL64, FME_ATTR_REAL80, FME_ATTR_STRING, FME_ATTR_ENCODED_STRING, FME_ATTR_INT64, FME_ATTR_UINT64.

Parameters:
  • attrName (string)
Returns: int
The type of the named attribute.

getCoordSys()

 

Get the Coordinate System of the feature.

Returns: string
The coordinate system of the feature.

getCoordinate(index)

 

Access the feature's individual coordinates by index. The index must be in the range 0 .. (numCoords() - 1).

The coordinates are returned as a tuple of floats.

Parameters:
  • index (int) - The index which the coordinate is accessed.
Returns: tuple of floats
The coordinate value at the given index.
Raises:
  • FMEException - An exception is raised if the index is outside the valid range.

getDimension()

 

Get the dimension of the feature.

Returns either fmeobjects.FME_TWO_D or fmeobjects.FME_THREE_D

Returns: int
The dimension of the feature.

getDonutParts()

 

Break a donut feature into its constituent parts. The first part is the outer shell of the donut polygon, and the following parts are the holes. All of the parts have the same attributes and feature type as the original feature.

Returns: list of FMEFeatures
A list of features representing the constituent parts of the original donut.
Raises:
  • FMEException - An exception is raised if an error occurred.

getFeatureType()

 

Get the Feature Type of the feature.

Returns: string
The feature type.

getGeometry()

 

Get the feature's geometry.

Returns: FMEGeometry of a terminal type
The geometry of the feature. Note: This method returns a terminal geometry type of the FMEGeometry; i.e. one of the leaf classes in the FMEGeometry inheritance graph. For example, a FMEPoint is returned if the geometry truly is a point.

getGeometryType()

 

Get the feature's classic geometry type.

Returns one of FME_GEOM_UNDEFINED, FME_GEOM_POINT, FME_GEOM_LINE, FME_GEOM_POLYGON, FME_GEOM_DONUT, FME_GEOM_PIP, or FME_GEOM_AGGREGATE

Returns: int
The geometry type of the feature.

getSequencedAttributeNames()

 

This method gets a list of sequenced attribute names in the order they were added to the feature. The attrNames list is only populated for schema features. The list will not contain sequenced attribute names for data features.

Returns: list of strings
A list of attribute names in the order they were added to the feature.

hasGeometry()

 
Returns: bool
True if the feature has a geometry and False otherwise.

hasRichGeometry()

 
Returns: bool
True if the feature's geometry takes advantage of the new geometry technology, and False otherwise.

importGeometryFromOGCWKB(ogcwkb)

 

Set the geometry of the feature to be that specified in the OGC Well Known Binary format. If the feature has geometry, then the geometry is replaced.

Parameters:
  • ogcwkb (bytearray Python 2.7, bytes Python 3) - Specifies the geometry of the feature.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

importGeometryFromOGCWKT(ogcwkt)

 

Set the geometry of the feature to be that specified in the OGC Well Known Text format. If the feature has geometry, then the geometry is replaced.

Parameters:
  • ogcwkt (string) - Specifies the geometry of the feature.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

interpolateSpline(numPointsPerSegment, calcPhantomPoints)

 

Perform interpolation on the feature.

Parameters:
  • numPointsPerSegment (int) - The number of points per segment.
  • calcPhantomPoints (bool) - Whether to calculate phantom points.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

makeDonuts(featureList)

 

Construct a donut polygon from the list of features provided. If multiple donut polygons are formed then the resulting geometry is an aggregate of these donuts.

Parameters:
  • featureList (list of FMEFeatures) - The list of features to make the donut from.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

matrixTransform(matrix)

 

Perform a 2D or 3D matrix transformation on the feature. Note: The passed in matrix must be in row-wise order.

Parameters:
  • matrix ((float, float), (float, float) or (float, float, float), (float, float, float), (float, float, float)) - The matrix to use for the transformation.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

mergeAttributes(destFeature)

 

Set the featureType and attributes of the feature passed in from the current feature, but ONLY if those attributes are not already present. The geometry is not touched. The original attributes on the destFeature are not lost.

Parameters:
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

numCoords()

 

Get the number of coordinates in the feature.

We recommend limited use of this method since it returns numVertices() + numParts() for multi-part features. A true vertex count will be returned by numVertices().

Returns: int
Returns the number of coordinates in the feature.

numParts(flatten, splitDonuts)

 

Get the number of parts that make up the geometry of the feature.

Parameters:
  • flatten (bool) - If flatten is True, then return the number of primitive parts drilling down into sub aggregates. If flatten is False then it returns the number of high level parts with some parts potentially being aggregates.
  • splitDonuts (bool) - If splitDonuts is True, each ring of a donut will count as a separate part.
Returns: int
The number of parts that make up the feature.

numVertices()

 

Get the number of vertices that make up the geometry of the feature Multi-part (aggregate) geometries are handled properly.

For simple geometries, the same value is returned as in numCoords()

Returns: int
The number of vertices that make up the feature.

offset(x, y, z)

 

Offsets the feature by the given amounts. (2D or 3D)

Parameters:
  • x (float) - The x coordinate to offset by.
  • y (float) - The y coordinate to offset by.
  • z (float) - (Optional) The z coordinate to offset by: Default value = 0.0
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

orient(rule)

 

Optionally set and get the orientation rule of the feature. This descends into aggregates and orients any polygons or donuts found. Geometries other than polygons or donuts are left unchanged.

Parameters:
  • rule (int) - (Optional) If the parameter is not supplied, the orientation is not changed. If the rule is supplied, the feature is adjusted so that rule is followed.

    With the right hand rule, the area of the polygon is always on the right and the coordinates of the outer boundary are in the clockwise direction, and for any holes they are counterclockwise.

Returns: int
The orientation rule of the feature.
Raises:
  • FMEException - An exception is raised if an error occurred.

outerShell()

 

Set the geometry of the feature to be just its outer shell. This has no effect on non-area features.

Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

performFunction(functionSpecification)

 

Call any FME function on the feature. See the FME documentation for the format of the functions. The function string passed in to this function follows the syntax of the manual exactly. Note that no spaces should be present between any parameters of the function, or between the function name and the '('. Additionally, do not call this method during a writer's close() method.

Parameters:
  • functionSpecification (string) - The function specification.
Returns: string
The function's result.
Raises:
  • FMEException - An exception is raised if an error occurred.

processFeatures(featureList, paramList)

 

Perform some general processing operation on a list of features. The operation performed is governed by the contents of paramList.

Parameters:
  • featureList (list of FMEFeatures) - The list of features to process.
  • paramList (list of strings) - The first entry in the array determines the type of operation.

    The following types of operations are supported:

    • 'fme_convert_to_area': The contents of the feature list are assumed to be a collection of lines. These lines are then formed into polygons. The polygons which result are turned into donuts and aggregated. Any holes are themselves dropped from the result. The single resulting area geometry is applied to the current feature.
    • 'fme_polygon_dissolve': The contents of the feature list are assumed to be a collection of polygons. If there are non-polygon features, then they will be filtered out. The collection of polygon features will be dissolved and the result will be applied to the current feature. Dissolved polygons are those polygons formed when shared edges between adjacent polygons are removed. This operation assumes that all input polygons are properly noded, a vertex is present at each intersection point, and that polygons are not overlapping.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred. The current feature's geometry may be in an undefined state.

removeAttribute(attrName)

 

Remove the named attribute if it exists.

Parameters:
  • attrName (string) - The name of the attribute to remove.
Returns: None

removeAttrsWithPrefix(attrPrefix)

 

Remove all attributes with the specified prefix.

Parameters:
  • attrPrefix (string) - The prefix used to remove attributes.
Returns: None

removeGeometry()

 

Remove and return the feature's geometry. The feature loses its geometry and can no longer be accessed.

Returns: FMEGeometry of a terminal type
The geometry of the feature. Note: This method returns a terminal geometry type of the FMEGeometry; i.e. one of the leaf classes in the FMEGeometry inheritance graph. For example, a FMEPoint is returned if the geometry truly is a point.

removeTraits(regexp)

 
Parameters:
  • regexp (string) - (Optional) All traits matching this regular expression are removed. If no expression is supplied, all traits are removed.
Returns: None

reproject(coordSys)

 

Reproject the feature from its current coordinate system to that specified. If the feature has no coordinate system specified then this has the same effect as the setCoordSys method.

Parameters:
  • coordSys (string) - The coordinate system to set on the feature.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

resetFeature()

 

Reset (clear) all the attributes and geometry of the feature. It results in a fresh clean feature.

Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

rotate2D(origin, angle)

 

Rotate the feature counterclockwise around the origin point by the specified angle (in degrees)

Parameters:
  • origin ((float, float)) - The origin of the feature.
  • angle (float) - The angle (in degrees) which to rotate the feature in the counterclockwise direction.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

scale(x, y, z)

 

Scale the feature by the given amounts. (2D or 3D)

Parameters:
  • x (float) - The value to scale x by.
  • y (float) - The value to scale y by.
  • z (float) - (Optional) The value to scale z by: Default value = 1.0
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

serialize(parameters)

 

Write the state of the FMEFeature to a string buffer.

Parameters:
  • parameters (dict) - (Optional) Possible name-value pairs are:

    'fme_feature_serialize_option'

    • 'fme_feature_full_feature': (Default) Serialize the full full feature.
    • 'fme_feature_geometry': Serialize the geometry portion of a feature only. This includes coordinates, coordinate system, and geometry attributes.

    'fme_feature_serialize_exclude_attr'

    • Attribute names to exclude: The names of the attributes to exclude when doing feature serialization. The value can be a single string or a list.

    'fme_feature_serialize_sidecar_basename'

    • File in which to store extra geometry data: The path and basename (not including file extension) to which additional data will be written for some geometries (raster, point cloud). If this option is not specified for those geometries, the extra data will not be written.
Returns: bytearray Python 2.7, bytes Python 3, or None
The buffer on success, None otherwise.

setAttribute(attrName, attrValue)

 

Supply a new attribute for the feature. If the attribute already exists, it will be overwritten. The following type numeric mappings are used:

PyInt ==> FME_Int32

PyFloat ==> FME_Real64

PyLong ==> FME_Int64

For Python 2.7, encoded values are to be specified as unicode strings. Binary values are to be specified as bytearray values.

For Python 3, binary values are to be specified as bytes values.

Parameters:
  • attrName (string) - The name of the attribute to set.
  • attrValue (bool, int, long, float, string, list of strings, unicode Python 2.7 only, list of unicode Python 2.7 only, bytearray, list of bytearray, bytes Python 3 only, or list of bytes Python 3 only) - The new value for the attribute.
Returns: None

setAttributeNullWithType(attributeName, attributeType)

 

This method supplies a null attribute with a type to the feature. If an attribute with the same name already exists, it is overwritten.

Attribute type must be one of FME_ATTR_UNDEFINED, FME_ATTR_BOOLEAN, FME_ATTR_INT8, FME_ATTR_UINT8, FME_ATTR_INT16, FME_ATTR_UINT16, FME_ATTR_INT32, FME_ATTR_UINT32, FME_ATTR_REAL32, FME_ATTR_REAL64, FME_ATTR_REAL80, FME_ATTR_STRING, FME_ATTR_ENCODED_STRING, FME_ATTR_INT64, FME_ATTR_UINT64.

Parameters:
  • attributeName (string) - The attribute's name.
  • attributeType (int) - An integer representing the attribute type.
Returns: none

setCoordSys(coordSys)

 

Set the Coordinate System of the feature.

Parameters:
  • coordSys (string) - The coordinate system to set on the feature.
Returns: None

setDimension(dimension)

 

Set the dimension of the feature.

dimension must either be fmeobjects.FME_TWO_D or fmeobjects.FME_THREE_D

Parameters:
  • dimension (int) - The dimension to set on the feature.
Returns: None

setFeatureType(featureType)

 

This method sets the feature type of the FME Feature. The feature type is often also called the "class" or "category" of the feature.

The feature type set on a feature through this method will change as the feature is routed through a translation pipeline.

Parameters:
  • featureType (string) - The feature type to set on the feature.
Returns: None

setGeometry(geometry)

 

Set the feature's geometry. Any existing geometry on the feature is overwritten.

Parameters:
  • geometry (FMEGeometry) - The geometry to set the feature to.
Returns: None

setGeometryType(geomType)

 

Set the feature's classic geometry type.

geomType must one of FME_GEOM_UNDEFINED, FME_GEOM_POINT, FME_GEOM_LINE, FME_GEOM_POLYGON, FME_GEOM_DONUT, FME_GEOM_PIP, or FME_GEOM_AGGREGATE

Parameters:
  • geomType (int) - The geometry type to set the feature to.
Returns: None

setSequencedAttribute(attrName, attrValue)

 

Supply a new attribute for the feature, but in such a way that the sequence is remembered. This is needed for schema features, to preserve the order of attributes. For Python 2.7, encoded values are to be specified as unicode strings.

Parameters:
  • attrName (string) - The name of the attribute to set.
  • attrValue (string or unicode Python 2.7 only) - The new value for the attribute.
Returns: None

splitAggregate(recurse)

 

Split up an aggregate feature into pieces, all of which have the same attributes and feature type. If the recurse flag is True, all aggregates within the aggregate are also split recursively, so no aggregates are ever returned as pieces. This method will only return points, lines, polygons, and null geometries (and possibly aggregates if recurse is False). All other geometries will be converted to these when split.

Parameters:
  • recurse (bool) - (Optional) Whether to recursively split the aggregate until no aggregates remain. Default value: False
Returns: list of FMEFeature
A list of features resulting from the splitting of the original aggregate.
Raises:
  • FMEException - An exception is raised if an error occurred.