fmeobjects.FMEFeature
|
If the feature is two-dimensional, any provided third coordinate is ignored. |
|
Adds coordinates onto the feature. |
This method returns the bounding box of the feature. |
|
This method returns the bounding cube of the feature. |
|
|
This method generates a buffer around the feature. |
|
Create an aggregate feature from the supplied list of features. |
|
Change the letter case of attribute names and values. |
|
Convert a feature into an aggregate where each member of the aggregate has fewer than the threshold number of vertices. |
Create a new |
|
Create a new |
|
|
Strokes an arc feature to be a polygon or line. |
Return the bounding cube of the feature in the format ((min x, min y, min z), (max x, max y, max z)) Strokes an arc feature to be a polygon or line. |
|
|
Strokes an arc feature to be a polygon or line. |
Converts the feature into a point feature with attributes required to define it as an arc. |
|
|
Restore the state of the |
|
Convert the geometry of the feature to the OGC Well Known Binary format. |
|
Convert the geometry of the feature to the OGC Well Known Text format. |
Generate a point somewhere inside the polygon. |
|
This method returns a complete, exhaustive list of all the attribute names present in the feature. |
|
Get all the coordinates in this feature. |
|
|
Get the value of the named attribute. |
|
This method is deprecated as of FME 2021.0. |
This method is deprecated as of FME 2021.0. |
|
|
Get the type of the named attribute. |
Get the Coordinate System of the feature. |
|
|
Access the feature's individual coordinates by index. |
Get the dimension of the feature. |
|
Break a donut feature into its constituent parts. |
|
Get the Feature Type of the feature. |
|
Get the feature's geometry. |
|
Get the feature's classic geometry type. |
|
This method gets a list of sequenced attribute names in the order they were added to the feature. |
|
This method is deprecated as of FME 2022.1. |
|
This method is deprecated as of FME 2021.0. |
|
Set the geometry of the feature to be that specified in the OGC Well Known Binary format. |
|
Set the geometry of the feature to be that specified in the OGC Well Known Text format. |
|
Perform interpolation on the feature. |
|
|
This method returns a boolean indicating if the attribute name maps to no value on the feature. |
|
This method returns a boolean indicating if the attribute name maps to a null attribute value on the feature. |
|
Construct a donut polygon from the list of features provided. |
|
Perform a 2D or 3D matrix transformation on the feature. |
|
Set the featureType and attributes of the feature passed in from the current feature, but ONLY if those attributes are not already present. |
Get the number of coordinates in the feature. |
|
|
Get the number of parts that make up the geometry of the feature. |
Get the number of vertices that make up the geometry of the feature Multi-part (aggregate) geometries are handled properly. |
|
|
Offsets the feature by the given amounts. |
|
Optionally set and get the orientation rule of the feature. |
Set the geometry of the feature to be just its outer shell. |
|
|
Call an FME function on the feature. |
|
Perform some general processing operation on a list of features. |
|
Remove the named attribute if it exists. |
|
Remove the named attribute if it exists. |
Remove and return the feature's geometry. |
|
|
Remove all or matching traits from the feature. |
|
Reproject the feature from its current coordinate system to that specified. |
Reset the number of coordinates in the feature to 0. |
|
Reset (clear) all the attributes and geometry of the feature. |
|
|
Rotate the feature counterclockwise around the origin point by the specified angle (in degrees). |
|
Scale the feature by the given amounts. |
|
Write the state of the |
|
Supply a new attribute for the feature. |
This method supplies a null attribute with a type to the feature. |
|
|
Set the Coordinate System of the feature. |
|
Dimension must either be |
|
This method sets the feature type of the |
|
Set the feature's geometry. |
|
Set the feature's classic geometry type. |
|
Supply a new attribute for the feature, but in such a way that the sequence is remembered. |
|
Split up an aggregate feature into pieces, all of which have the same attributes and feature type. |
- class FMEFeature
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.- Return type:
- Returns:
An instance of a Feature object.
init(feature)
Create a copy of the passed in Feature object.
- Parameters:
feature (FMEFeature) – The Feature object to create a copy of.
- Return type:
- Returns:
An instance of a Feature object.
- __init__(*args, **kwargs)
- addCoordinate(x, y, z=0.0)
If the feature is two-dimensional, any provided third coordinate is ignored.
- 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.
- boundingBox()
This method returns the bounding box of the feature.
- Return type:
- Returns:
The bounding box of the feature, in the form ((minx, miny), (maxx, maxy)).
- Raises:
FMEException – An exception is raised if an error occurred.
- boundingCube()
This method returns the bounding cube of the feature.
- Return type:
- Returns:
The bounding cube of the feature, in the form ((minx, miny, minz), (maxx, maxy, maxz)).
- 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:
- Return type:
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[FMEFeature]) – The list of features to build the aggregate from.
- Return type:
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:
Must be one of:
- Return type:
None
- Raises:
FMEException – An exception is raised if an error occurred.
- chopUp(vertexThreshold)
Convert a feature into an aggregate 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.
- Return type:
- Returns:
- Raises:
FMEException – An exception is raised if an error occurred.
- clone()
Create a new
FMEFeature
as a clone of this one.- Return type:
- Returns:
A clone of the original feature.
- Raises:
FMEException – An exception is raised if an error occurred.
- cloneAttributes()
Create a new
FMEFeature
with only the attributes of this one copied over.- Return type:
- Returns:
A new
FMEFeature
with the same attributes as the original.- 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:
- Return type:
None
- Raises:
FMEException – An exception is raised if an error occurred.
- convertArcToPointUseAttributes()
Return the bounding cube of the feature in the format ((min x, min y, min z), (max x, max y, max z)) 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.
- Return type:
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:
- Return type:
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:
- Return type:
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:
kFME_FeatureDeserializeOption
:kFME_FeatureDeserializeReset
: (Default) Reset the original feature before restoring the state of theFMEFeature
.kFME_FeatureDeserializeMerge
: When restoring the state of theFMEFeature
, 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.
kFME_FeatureDeserializeSidecarBasename
: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).
- exportGeometryToOGCWKB(version)
Convert the geometry of the feature to the OGC Well Known Binary format.
- Parameters:
version (int) –
(Optional) The OGC Version to use. Must be one of:
(Default value is
ogcvOneDotOne
).- Return type:
- Returns:
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:
version (int) –
(Optional) The OGC Version to use. Must be one of:
(Default value is
ogcvOneDotOne
).- Return type:
- Returns:
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 is
False
).- Return type:
- Returns:
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.
- getAllCoordinates()
Get all the coordinates in this feature. Returns a list of coordinates, each as a tuple of floats.
- getAttribute(attrName, desiredType, fallback)
Get the value of the named attribute. Null attribute values will be returned as an empty string. Binary blob attributes are returned as bytes.
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.For null attribute values, an empty string will be returned. In order to determine if an attribute is null, use
isAttributeNull
.Specifying a desired type will return the attribute value in the type specified. If the attribute value cannot be represented in the desired type, an exception will be raised.
In any cases where this method will fail either by a raised exception or a missing value, the method will return the fallback value if it’s specified.
- Parameters:
attrName (str) – The name of the attribute to get on the feature.
desiredType (type) – (Optional) The desired type for the attribute value to be returned as. Possible values are bool, int, float, str, bytes, bytearray, and list.
fallback (bool, int, float, str, bytes, bytearray, list, or None) – (Optional) If specified, this value is returned instead of raising FMEException on conversion failures.
- Return type:
- Returns:
The value of the named attribute.
- Raises:
FMEException – An exception is raised if there was a problem in retrieving the attribute value.
- getAttributeAsType(attrName, attrType, fallback)
This method is deprecated as of FME 2021.0. Please use
getAttribute
with desired type instead.Get the value of the named attribute, casted to the specified FME type, then to an appropriate python type.
An optional third parameter can be specified to be returned as a fallback in case type conversion fails.
Example: getAttributeAsType(“output_file_type”, fmeobjects.FME_ATTR_STRING, “png”)
The enum value fmeobjects.FME_ATTR_UNDEFINED can be used to retrieve a list object. If used to try and get a single attribute as a list, or a list as a single type, there is automatic conversion failure.
A return of
None
indicates the attribute does not exist.
- getAttributeNullMissingAndType(attributeName)
This method is deprecated as of FME 2021.0. Please use
isAttributeNull
,isAttributeMissing
, andgetAttributeType
instead.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 isFalse
. The second boolean isTrue
if attributeName maps to no value on the feature. Otherwise it isFalse
. If the attribute is absent,FME_ATTR_UNDEFINED
is returned for the type, otherwise the attribute type is returned.- Parameters:
attributeName (str) – The name of the attribute.
- Return type:
- Returns:
A tuple of 2 boolean values and an integer. The first boolean indicating whether or not the value of the attribute is null, the second boolean indicating whether or not the attribute is missing, and the integer representing the attribute type. Attribute type int values are represented by the constants
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
, orFME_ATTR_UINT64
.
- getAttributeType(attrName)
Get the type of the named attribute.
- Parameters:
attrName (str) – The name of the attribute to get on the feature.
- Return type:
- Returns:
The attribute type of the named attribute. Attribute types are int values represented by the constants
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
, orFME_ATTR_UINT64
.
- getCoordSys()
Get the Coordinate System of the feature.
- Return type:
- Returns:
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.
- Return type:
- Returns:
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
FME_TWO_D
orFME_THREE_D
- Return type:
- Returns:
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.
- Return type:
- Returns:
A list of features representing the constituent parts of the original donut.
- Raises:
FMEException – An exception is raised if an error occurred.
- getGeometry()
Get the feature’s geometry.
- Return type:
- Returns:
The geometry of the feature. Note: This method returns a terminal geometry type of the
FMEGeometry
; i.e. one of the leaf classes in theFMEGeometry
inheritance graph. For example, aFMEPoint
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
, orFME_GEOM_AGGREGATE
.- Return type:
- Returns:
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.
- hasGeometry()
This method is deprecated as of FME 2022.1.
Determine if a feature has geometry.
- hasRichGeometry()
This method is deprecated as of FME 2021.0.
Determine if the feature has geometry that takes advantage of the new geometry technology.
- 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) – Specifies the geometry of the feature.
- Return type:
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 (str) – Specifies the geometry of the feature.
- Return type:
None
- Raises:
FMEException – An exception is raised if an error occurred.
- interpolateSpline(numPointsPerSegment, calcPhantomPoints)
Perform interpolation on the feature.
- Parameters:
- Return type:
None
- Raises:
FMEException – An exception is raised if an error occurred.
- isAttributeMissing(attributeName)
This method returns a boolean indicating if the attribute name maps to no value on the feature.
- isAttributeNull(attributeName)
This method returns a boolean indicating if the attribute name maps to a null attribute value on the feature.
- 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[FMEFeature]) – The list of features to make the donut from.
- Return type:
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.
- 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:
destFeature (FMEFeature) – The original feature to set featureType and attributes on.
- Return type:
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 bynumVertices()
.- Return type:
- Returns:
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 isFalse
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.
- Return type:
- Returns:
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()
- Return type:
- Returns:
The number of vertices that make up the feature.
- offset(x, y, z)
Offsets the feature by the given amounts. (2D or 3D)
- Parameters:
- Return type:
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.
- Return type:
- Returns:
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.
- Return type:
None
- Raises:
FMEException – An exception is raised if an error occurred.
- performFunction(functionSpecification)
Call an FME function on the feature. See the FME Factory and Function Documentation for formatting and the list of supported functions. It may not support newer FME functions. Functions that are not supported will produce an error message indicating that the function is not recognized. The function string passed in to this function follows the syntax of the documentation exactly.
i.e. feature.performFunction(‘@Count()’)
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 (str) – The function specification.
- Return type:
- Returns:
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[FMEFeature]) – The list of features to process.
The first entry in the array determines the type of operation.
The following types of operations are supported:
kFME_ConvertToArea
: 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.kFME_PolygonDissolve
: 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.
- Return type:
- 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 (str) – The name of the attribute to remove.
- Return type:
None
- removeAttrsWithPrefix(attrPrefix)
Remove the named attribute if it exists.
- Parameters:
attrName (str) – The name of the attribute to remove.
- Return type:
None
- removeGeometry()
Remove and return the feature’s geometry. The feature loses its geometry and it can no longer be accessed.
- Return type:
- Returns:
The geometry of the feature. Note: This method returns a terminal geometry type of the
FMEGeometry
; i.e. one of the leaf classes in theFMEGeometry
inheritance graph. For example, aFMEPoint
is returned if the geometry truly is a point.
- removeTraits(regexp)
Remove all or matching traits from the feature.
- Parameters:
regexp (str) – (Optional) All traits matching this regular expression are removed. If no expression is supplied, all traits are removed.
- Return type:
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 (str) – The coordinate system to set on the feature.
- Return type:
None
- Raises:
FMEException – An exception is raised if an error occurred.
- resetCoords()
Reset the number of coordinates in the feature to 0.
- Return type:
None
- resetFeature()
Reset (clear) all the attributes and geometry of the feature. It results in a fresh clean feature.
- Return type:
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:
- Return type:
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:
- Return type:
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:
-
kFME_FeatureFullFeature
: (Default) Serialize the full full feature.kFME_FeatureGeometry
: Serialize the geometry portion of a feature only. This includes coordinates, coordinate system, and geometry attributes.
kFME_FeatureSerializeExcludeAttr
: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.
kFME_FeatureSerializeSidecarBasename
: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.
-
- Return type:
- Returns:
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
Binary values are to be specified as bytes or bytearray values.
If an attribute value of
None
is specified, the attribute value will be set as an empty string. To set a null attribute, usesetAttributeNullWithType
.For a list attribute, if the attribute already exists and contains more elements than the new list, the resulting list will be made up of the new list elements plus the old list elements that were not overwritten. Call
removeAttribute
first to avoid this behavior. Passing an empty list for the attribute value will have no effect.
- 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
orFME_ATTR_UINT64
.
- setCoordSys(coordSys)
Set the Coordinate System of the feature.
- Parameters:
coordSys (str) – The coordinate system to set on the feature.
- Return type:
None
- setDimension(dimension)
Dimension must either be
FME_TWO_D
orFME_THREE_D
- Parameters:
dimension (int) – The dimension to set on the feature.
- Return type:
None
- setFeatureType(featureType)
This method sets the feature type of the
FMEFeature
. 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 (str) – The feature type to set on the feature.
- Return type:
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.
- Return type:
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
, orFME_GEOM_AGGREGATE
.- Parameters:
geomType (int) – The geometry type to set the feature to.
- Return type:
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 a list attribute, if the attribute already exists and contains more elements than the new list, the resulting list will be made up of the new list elements plus the old list elements that were not overwritten. Call
removeAttribute
first to avoid this behavior.
- 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 isFalse
). 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 is
False
)- Return type:
- Returns:
A list of features resulting from the splitting of the original aggregate.
- Raises:
FMEException – An exception is raised if an error occurred.