fmeobjects.FMEPoint

Inheritance diagram of fmeobjects.FMEPoint

FMEPoint.boundingBox()

This method returns the bounding box of the geometry.

FMEPoint.boundingCube()

This method returns the bounding cube of the geometry.

FMEPoint.bounds()

Returns the bounds of the geometry.

FMEPoint.clearMeasures()

Remove all measures from the geometry.

FMEPoint.copyAttributesFromFeature(...)

Copies all the attributes from the given feature to traits on this geometry, if they match the (optional) regular expression.

FMEPoint.copyNameFromGeometry(sourceGeometry)

Copies the name of the 'sourceGeometry' onto this geometry.

FMEPoint.copyTraitsFromGeometry(...)

Copies all the traits from the given geometry that match the (optional) regular expression.

FMEPoint.copyTraitsToFeature(destFeature, ...)

Copies all the traits from this geometry to attributes on the given feature, if they match the (optional) regular expression.

FMEPoint.deleteName()

Deletes the geometry's name.

FMEPoint.equalCoordinate(point, checkZ)

Returns True if the two points have the identical coordinate.

FMEPoint.equalOrientation(point)

Returns True if the two points have identical rotations.

FMEPoint.equals(point)

Returns True if the two points have the identical coordinate and measures.

FMEPoint.force2D()

Reduces the geometry to 2D.

FMEPoint.force3D(newZ)

This sets the geometry's dimension to 3D.

FMEPoint.getArea()

Area calculation.

FMEPoint.getMeasureNames()

Retrieve the names of the measures on this geometry.

FMEPoint.getMeasureValue(measureName)

Returns the value of the default measure or the value of the measure named by 'measureName'.

FMEPoint.getName()

This routine retrieves the 'name' of this geometry as a str.

FMEPoint.getTrait(traitName)

Retrieves the geometry trait value of the specified trait name.

FMEPoint.getTraitNames()

Retrieve the names of the traits on this geometry.

FMEPoint.getTraitNullMissingAndType(traitName)

This method returns a tuple of a boolean, indicating if the trait is null, a boolean, indicating if the trait is missing, and an integer representing the type of the trait.

FMEPoint.getTraitType(traitName)

Returns the type of given trait.

FMEPoint.getXYZ()

Get the coordinate value.

FMEPoint.hasMeasures()

Check if this geometry or any sub part of this geometry has measures.

FMEPoint.hasName()

Returns whether or not the geometry has a name.

FMEPoint.is3D()

Returns whether or not the geometry is 3D.

FMEPoint.isCollection()

Check if the geometry is an aggregate or multi-part collection.

FMEPoint.measureExists(measureName)

Returns True if the specified measure exists and False otherwise.

FMEPoint.offset(offsetPoint)

Offsets the geometry by the coords specified by 'offsetPoint'.

FMEPoint.removeMeasure(measureName)

Remove the specified measure.

FMEPoint.removeTraits(regexp)

This method has 4 modes:

FMEPoint.renameMeasure(oldMeasureName, ...)

Renames the measure specified by 'oldMeasureName' to the new name, specified by 'newMeasureName'.

FMEPoint.reset(point)

Set the coordinate and measure values to the values in the given point.

FMEPoint.rotate2D(center, angle)

Rotates the point.

FMEPoint.scale(xScale, yScale, zScale)

'zScale' is ignored if geometry is 2D.

FMEPoint.setMeasure(measureValue, measureName)

Sets the value of the default measure, or creates the default measure if it doesn't exist.

FMEPoint.setName(name)

Sets the geometry's name with a str.

FMEPoint.setTrait(traitName, traitValue)

Sets a geometry trait with the specified value.

FMEPoint.setTraitNullWithType(traitName, ...)

This method supplies a null trait value with a type to the geometry.

FMEPoint.setX(newX)

Set the x coordinate value.

FMEPoint.setXYZ(newX, newY, newZ)

Set the coordinate value.

FMEPoint.setXYZAsTuple(point)

Set the coordinate value as a tuple.

FMEPoint.setY(newY)

Set the y coordinate value.

FMEPoint.setZ(newZ)

Set the z coordinate value.

class FMEPoint

FME Point Class

Create an instance of a Point geometry object.

init()

Default FMEPoint constructor.

Return type:

FMEPoint

Returns:

An instance of a Point Geometry object.

init(x,y,z)

Creates a point with the given xyz coordinates.

Parameters:
  • x (float) – The x value to set.

  • y (float) – The y value to set.

  • z (float) – (Optional) The z value to set.

Return type:

FMEPoint

Returns:

An instance of a Point Geometry object.

init(point)

Create a copy of the passed in Point geometry object.

Parameters:

point (FMEPoint) – The Point geometry object to create a copy of.

Return type:

FMEPoint

Returns:

An instance of a Point Geometry object.

__init__(*args, **kwargs)
boundingBox()

This method returns the bounding box of the geometry.

Return type:

tuple[tuple[float]]

Returns:

The bounding box of the Geometry, in the form ((minx, miny), (maxx, maxy)).

boundingCube()

This method returns the bounding cube of the geometry.

Return type:

tuple[tuple[float]]

Returns:

The bounding box of the Geometry, in the form ((minx, miny, minz), (maxx, maxy, maxz)).

bounds()

Returns the bounds of the geometry.

Return type:

tuple[FMEPoint]

Returns:

The min point and max point of the bounds. None is returned if the geometry contains no points.

clearMeasures()

Remove all measures from the geometry.

Return type:

None

copyAttributesFromFeature(sourceFeature, overwriteExisting, regexp, prefix)

Copies all the attributes from the given feature to traits on this geometry, if they match the (optional) regular expression.

Parameters:
  • sourceFeature (FMEFeature) – The feature to copy attributes from.

  • overwriteExisting (bool) – Existing traits will be overwritten only if overwriteExisting is True.

  • regexp (str) – (Optional) The regular expression to match the attributes against. If regexp is not specified, then all attributes will be copied.

  • prefix (str) – (Optional) The prefix is put on all the trait names as they are copied. If it is not specified, a prefix will not be added to the trait names.

Return type:

None

copyNameFromGeometry(sourceGeometry)

Copies the name of the ‘sourceGeometry’ onto this geometry. If ‘sourceGeometry’s name is blank or None, this geometry’s name will become None.

Parameters:

sourceGeometry (FMEGeometry) – The geometry to copy the name from.

Return type:

None

copyTraitsFromGeometry(sourceGeometry, overwriteExisting, regexp, prefix)

Copies all the traits from the given geometry that match the (optional) regular expression.

Parameters:
  • sourceGeometry (FMEGeometry) – The geometry to copy traits from.

  • overwriteExisting (bool) – Existing traits will be overwritten only if overwriteExisting is True.

  • regexp (str) – (Optional) The regular expression to match the traits against. If regexp is not specified, or is an empty string, then all traits will be copied.

  • prefix (str) – (Optional) The prefix is put on all the trait names as they are copied. If it is not specified, a prefix will not be added to the trait names.

Return type:

None

copyTraitsToFeature(destFeature, overwriteExisting, regexp, prefix)

Copies all the traits from this geometry to attributes on the given feature, if they match the (optional) regular expression.

Parameters:
  • destFeature (FMEFeature) – The feature to copy traits to.

  • overwriteExisting (bool) – Existing attributes will be overwritten only if overwriteExisting is True.

  • regexp (str) – (Optional) The regular expression to match the traits against. If regexp is not specified, or is an empty string, then all traits will be copied.

  • prefix (str) – (Optional) The prefix is put on all the attribute names as they are copied. If it is not specified, a prefix will not be added to the attribute names.

Return type:

None

deleteName()

Deletes the geometry’s name. If a name existed prior to this call then True is returned; otherwise False is returned.

Return type:

bool

Returns:

Returns a boolean indicating whether or not the name existed before deletion.

equalCoordinate(point, checkZ)

Returns True if the two points have the identical coordinate. Z coordinate values are checked only if ‘checkZ’ is True. Measures are not compared.

Parameters:
  • point (FMEPoint) – The point to compare to.

  • checkZ (bool) – If set to True, z coordinate values will be checked.

Return type:

bool

Returns:

True if the two points have identical coordinates, False otherwise.

equalOrientation(point)

Returns True if the two points have identical rotations. Measures are not compared.

Parameters:

point (FMEPoint) – The point to compare to.

Return type:

bool

Returns:

True if the two points have identical rotations, False otherwise.

equals(point)

Returns True if the two points have the identical coordinate and measures.

Parameters:

point (FMEPoint) – The other point to compare to.

Return type:

bool

Returns:

True if the two points have identical coordinate and measures, False otherwise.

force2D()

Reduces the geometry to 2D.

Return type:

None

force3D(newZ)

This sets the geometry’s dimension to 3D. All Z values are set to the value passed in, even if the geometry is already 3D.

Parameters:

newZ (float) – The new Z value.

Return type:

None

getArea()

Area calculation.

Return type:

float

Returns:

The calculated area.

getMeasureNames()

Retrieve the names of the measures on this geometry.

Return type:

tuple[str]

Returns:

Return a tuple storing the names of the measures on this geometry. This will return an empty tuple if there are no measures. For FMEAggregate, FMEMultiSurface, and FMECompositeSurface, this will return the union of all measure names of all of its parts.

getMeasureValue(measureName)

Returns the value of the default measure or the value of the measure named by ‘measureName’.

Parameters:

measureName (str) – (Optional) The name of the measure whose value is to be returned.

Return type:

float

Returns:

The value of the default measure, or the measure named by ‘measureName’.

Raises:

FMEException – An exception is raised if an error occurred.

getName()

This routine retrieves the ‘name’ of this geometry as a str. This will return None if it did not have a name associated with it.

Return type:

str or None

Returns:

The geometry’s name.

getTrait(traitName)

Retrieves the geometry trait value of the specified trait name. Null trait values will be returned as an empty string. Binary blob traits are returned as a bytearray.

None is returned when the trait is not found on the geometry.

Parameters:

traitName (str) – The name of the geometry trait.

Return type:

bool, int, float, str, bytearray, bytes or None

Returns:

The trait value.

Raises:

FMEException – An exception is raised if there was a problem in retrieving the trait value.

getTraitNames()

Retrieve the names of the traits on this geometry.

Return type:

tuple[str]

Returns:

Return a tuple storing the names of the traits on this geometry. This will return an empty tuple if there are no traits. For all collections and containers, this will only return the names of traits on the outermost object only.

getTraitNullMissingAndType(traitName)

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

The possible trait 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:

traitName (str) – The trait’s name.

Return type:

tuple[bool, bool, int]

Returns:

A tuple of 2 boolean values the first indicating whether or not the value of the trait is null, the second indicating whether or not the trait is missing, and an integer representing the trait type.

getTraitType(traitName)

Returns the type of given trait. If the trait cannot be found, FME_ATTR_UNDEFINED will be returned.

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:

traitName (str) – The trait’s name.

Return type:

int

Returns:

The trait type.

getXYZ()

Get the coordinate value. 0.0 is returned for the z value if the point is 2D.

Return type:

tuple[float]

Returns:

The coordinate value of the point.

hasMeasures()

Check if this geometry or any sub part of this geometry has measures.

Return type:

bool

Returns:

True if this geometry or any sub part of this geometry has measures, False otherwise.

hasName()

Returns whether or not the geometry has a name.

Return type:

bool

Returns:

Returns True if the geometry has a name and False otherwise.

is3D()

Returns whether or not the geometry is 3D.

Return type:

bool

Returns:

Returns True if the geometry is 3D and False otherwise. For FMENull, this method will always return True. For FMEAggregate, FMEMultiPoint, FMEMultiArea, FMEMultiText and FMEMultiCurve, this method will return True if any one of the sub-parts is 3D. If the collection is empty or all of its members are 2D, this method will return False.

isCollection()

Check if the geometry is an aggregate or multi-part collection.

Return type:

bool

Returns:

True if the geometry is an aggregate or multi-part collection.

measureExists(measureName)

Returns True if the specified measure exists and False otherwise. If the ‘measureName’ parameter is not specified then the default measure is checked.

Parameters:

measureName (str) – (Optional) The measure’s name.

Return type:

bool

Returns:

Boolean indicating whether or not the measure exists.

offset(offsetPoint)

Offsets the geometry by the coords specified by ‘offsetPoint’.

Parameters:

offsetPoint (FMEPoint) – The offset point.

Return type:

None

Raises:

FMEException – An exception is raised if an error occurred.

removeMeasure(measureName)

Remove the specified measure. If ‘measureName’ is not supplied, remove the the default measure.

Parameters:

measureName (str) – (Optional) The name of the measure to be removed.

Return type:

None

removeTraits(regexp)

This method has 4 modes:

  1. Remove all traits at the top level: regex == NULL

  2. Remove some traits at the top level: regex == <string>

  3. Remove all traits at all levels: regex == kFME_RecurseAll

  4. Remove some traits at all levels: regex == kFME_RecurseSome <string>

For example, specifying regex == NULL for a multi-surface will remove all traits at the root level of the multi-surface, whereas specifying regex == kFME_RecurseSome <string> will remove all traits from all levels of the multi surface that match <string>. If <string> is an illegal regular expression, no traits will be removed.

Return type:

None

renameMeasure(oldMeasureName, newMeasureName)

Renames the measure specified by ‘oldMeasureName’ to the new name, specified by ‘newMeasureName’.

Parameters:
  • oldMeasureName (str) – The original name of the measure.

  • newMeasureName (str) – The new name of the measure.

Return type:

None

reset(point)

Set the coordinate and measure values to the values in the given point. The point is forced to 3D if necessary. All existing measures are lost.

Parameters:

point (FMEPoint) – The point to reset the coordinate and measure values to.

Return type:

None

rotate2D(center, angle)

Rotates the point.

Parameters:
  • center (FMEPoint) – The center point.

  • angle (float) – The angle to rotate by. The angle is counter-clockwise up from the horizontal, and measured in degrees.

Return type:

None

Raises:

FMEException – An exception is raised if an error occurred.

scale(xScale, yScale, zScale)

‘zScale’ is ignored if geometry is 2D.

Parameters:
  • xScale (float) – The value to scale x by.

  • yScale (float) – The value to scale y by.

  • zScale (float) – (Optional) The value to scale z by.

Return type:

None

Raises:

FMEException – An exception is raised if an error occurred.

setMeasure(measureValue, measureName)

Sets the value of the default measure, or creates the default measure if it doesn’t exist. If a ‘measureName’ is supplied, this method sets the value of the named measure, or creates the measure if it doesn’t exist.

Parameters:
  • measureValue (float) – The value of the measure

  • measureName (str) – (Optional) The name of the measure whose value is to be set, or created.

Return type:

None

setName(name)

Sets the geometry’s name with a str. By supplying a blank name as input, this method will act as deleteName().

Parameters:

name (str) – The geometry’s new name.

Return type:

None

setTrait(traitName, traitValue)

Sets a geometry trait with the specified value. If the geometry trait already exists, its value and type will be changed. The following type numeric mappings are used:

PyInt ==> FME_Int32

PyFloat ==> FME_Real64

PyLong ==> FME_Int64

Binary values are to be specified as bytearray values or bytes values.

Parameters:
Return type:

None

setTraitNullWithType(traitName, traitType)

This method supplies a null trait value with a type to the geometry. If a trait with the same name already exists, it is overwritten.

Trait 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:
  • traitName (str) – The trait’s name.

  • traitType (int) – An integer representing the trait type.

Return type:

None

setX(newX)

Set the x coordinate value.

Parameters:

newX (float) – The new X value.

Return type:

None

setXYZ(newX, newY, newZ)

Set the coordinate value. The point is forced to 3D if necessary.

Parameters:
  • newX (float) – The new x value.

  • newY (float) – The new y value.

  • newZ (float) – (Optional) The new z value.

Return type:

None

setXYZAsTuple(point)

Set the coordinate value as a tuple. The point is forced to 3D if necessary.

Parameters:

point (tuple[float]) – The tuple to set the point to.

Return type:

None

setY(newY)

Set the y coordinate value.

Parameters:

newY (float) – The new y value.

Return type:

None

setZ(newZ)

Set the z coordinate value.

Parameters:

newZ (float) – The new z value.

Return type:

None