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

Class FMELine

 object --+            
          |            
FMEGeometry --+        
              |        
       FMECurve --+    
                  |    
         FMESegment --+
                      |
                     FMELine

init(MultipleInvocations)

Create an instance of a Line geometry object.

init()

Default FMELine constructor.

Returns: FMELine

init(is3D)

Constructs a 3D line if 'is3D' is True, otherwise a 2D line is created.

Parameters

Returns: FMELine

init(points)

Creates a line consisting of the list of points passed in.

Parameters

Returns: FMELine

init(line)

Create a copy of the passed in Line geometry object.

Parameters

Returns: FMELine

Instance Methods [hide private]
 
__init__(MultipleInvocations)
x.__init__(...) initializes x; see help(type(x)) for signature
None
appendLine(line)
Appends 'line' to the end the existing line.
None
appendPoint(point)
Appends 'point' to the end of the line.
None
appendPoints(points)
Appends 'points' to the end of the line.
float
getMeasureValueAt(index, measureName)
Get the value of the default measure at the 'index'.
list of float
getMeasureValues(measureName)
Returns the value of the default measure, or the measure named by 'measureName'.
FMEPoint
getPointAt(index)
Gets the point at the specified 'index'.
list of FMEPoint
getPoints()
Gets the points of the line as a list of FMEPoint objects.
int
indexOfCoord(coord)
Returns the index of the first coordinate defined within the tuple 'coord', or FME_NPOS32 if no such coordinate is found.
None
insertPointAtIndex(point, index)
Insert the point 'index'.
int
numPoints()
Returns the number of points which are stored.
FMEPoint
removePointAt(index)
Remove the point at 'index'.
None
reset(coords)
Resets the coordinates to an 'empty' state.
None
setMeasure(measureValues, measureName)
Set the default measure to the given values.
None
setMeasureAt(index, measureValue, measureName)
Set the default measure of the point at 'index' to the given 'measureValue'.
None
setPointAt(index, point)
Sets 'point' at the specified index.

Inherited from FMECurve: getAsLine, getAsLineFixedArcSamples, getEndPoint, getLength, getStartPoint, isClosed, isLinear, offset, removeDuplicates, removeMeasure, reverse, rotate2D, scale, setEndPoint, setStartPoint, snip, snipByPoints

Inherited from FMEGeometry: __getObject__, __new__, boundingBox, boundingCube, bounds, clearMeasures, copyAttributesFromFeature, copyNameFromGeometry, copyTraitsFromGeometry, copyTraitsToFeature, deleteName, force2D, force3D, getArea, getMeasureNames, getName, getTrait, getTraitNames, getTraitNullMissingAndType, getTraitType, hasMeasures, hasName, is3D, isCollection, measureExists, removeTraits, renameMeasure, setName, setTrait, setTraitNullWithType

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__

appendLine(line)

 

Appends 'line' to the end the existing line. If the existing line has no coordinates it will have its geometry dimension set based on the first append call made. This line's points will be forced to have a consistent dimension. If a 2D line is appended to a 3D line, the 2D line will be changed to 3D with a Z value of 0.0. If a 3D line is appended to a 2D line, the 2D line will be changed to 3D with 0.0 for all Z values. The appended line will be forced to have consistent measures. Any unspecified measure values will be set to None.

Parameters:
  • line (FMELine) - The line to append.
Returns: None

appendPoint(point)

 

Appends 'point' to the end of the line. Lines with no coordinates will have their dimension set based on the first append call made. The line's points will be forced to have a consistent dimension. If a 2D point is appended to a 3D line, the point will be changed to 3D with a Z value of 0.0. If a 3D point is appended to a 2D line, the line will be changed to 3D with 0.0 for all Z values. The points will be forced to have consistent measures. Any unspecified measure values will be set to None. Nothing is appended if None is passed in.

Parameters:
  • point (FMEPoint or tuple) - The point to append to the line.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

appendPoints(points)

 

Appends 'points' to the end of the line. Lines with no coordinates will have their geometry dimension set based on the first append call made. If this method is called on a 3D line, a Z value of 0.0 will be used for each appended point. If this method is called on a 2D line, the line will be forced to 3D with a default Z value of 0.0. Because this method does not specify measure values, a value of None will be used for each point for any existing measures.

Parameters:
  • points (list of FMEPoint and/or list) - The list of points to be added.
Returns: None

getMeasureValueAt(index, measureName)

 

Get the value of the default measure at the 'index'. If 'measureName' is supplied, this method gets the value of the named measure at 'index'. Returns an error if the measure doesn't exist or 'index' is out of range.

Parameters:
  • index (int) - The index where to retrieve the value from.
  • measureName (string) - (Optional) The name of the measure whose value is to be returned.
Returns: float
The value of the default measure at the given index, or the measure named by 'measureName' at the given index.
Raises:
  • FMEException - An exception is raised if an error occurred.

getMeasureValues(measureName)

 

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

Parameters:
  • measureName (string) - (Optional) The name of the measure whose value is to be returned.
Returns: list of float
The values of the default measure, or the measures named by 'measureName'.
Raises:
  • FMEException - An exception is raised if an error occurred.

getPointAt(index)

 

Gets the point at the specified 'index'. An error is returned if the index is out of range.

Parameters:
  • index (int) - The index which to retrieve the point from.
Returns: FMEPoint
The point at the supplied index.
Raises:
  • FMEException - An exception is raised if an error occurred.

getPoints()

 

Gets the points of the line as a list of FMEPoint objects. The size of the given list must be exactly equal to the value returned by numPoints(). If the line is 2D the z values of the line will be populated with 0.0 values. Returns an error if an error occurred.

Returns: list of FMEPoint
A list of points contained within the line.
Raises:
  • FMEException - An exception is raised if an error occurred.

indexOfCoord(coord)

 

Returns the index of the first coordinate defined within the tuple 'coord', or FME_NPOS32 if no such coordinate is found.

Parameters:
  • coord (tuple) - The z tuple containing coordinate whose index to search.
Returns: int
The index of the supplied coordinate, or FME_NPOS32 if no such coordinate exists.

insertPointAtIndex(point, index)

 

Insert the point 'index'. All points from that index on will be shifted to allow room for the new point. Any new measures added to the point will be set a default of None.

Parameters:
  • point (FMEPoint) - The point to insert.
  • index (int) - The index of the point to remove.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

numPoints()

 

Returns the number of points which are stored.

Returns: int
The number of points which are stored in the line.

removePointAt(index)

 

Remove the point at 'index'. Null is returned if the index is out of range.

Parameters:
  • index (int) - The index of the point to remove.
Returns: FMEPoint
The point removed, or None if the index is out of range.

reset(coords)

 

Resets the coordinates to an 'empty' state. It does not alter the geometry dimension, but it does remove all measures. If 'coords' is supplied, then this method sets the line's coordinates to the values in the supplied 'coords' list. None zCoord values will result in a 2D line, otherwise a 3D line is created. This method removes all measures.

Parameters:
  • coords (list of tuple) - (Optional) The list of coordinate tuples to add after the reset.
Returns: None

setMeasure(measureValues, measureName)

 

Set the default measure to the given values. Create the measure if it doesn't already exist. If 'measureName' is supplied, this method sets the given measure to 'measureValues', or creates the measure if it doesn't already exist. The size of measureValues must be exactly equal to the value returned by numPoints().

Parameters:
  • measureValues (list of float) - The values of the measure.
  • measureName (string) - (Optional) The name of the measure whose value is to be set, or created.
Returns: None

setMeasureAt(index, measureValue, measureName)

 

Set the default measure of the point at 'index' to the given 'measureValue'. If 'measureName' is supplied, this method sets the given measure of the point at 'index' to 'measureValue'. Creates the measure if it doesn't already exist and set the measures to all points other than the point at the given index to None. Return an error if the index is out of range.

Parameters:
  • index (int) - The index of the measure to set.
  • measureValue (float) - The value of the measure.
  • measureName (string) - (Optional) The name of the measure whose value is to be set, or created.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

setPointAt(index, point)

 

Sets 'point' at the specified index. The line's points will be forced to have a consistent dimension. If any points are 3D, they all must be. A Z value of 0.0 is used when converting from a 2D point to a 3D point. The points will be forced to have consistent measures. Any unspecified measure values will be set to None. An error is returned if the index is out of range.

Parameters:
  • index (int) - The index which to set the point.
  • point (FMEPoint or tuple) - The point to set at the given index.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.