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

Class FMEReprojector

object --+
         |
        FMEReprojector

init(MultipleInvocations)

Creates a new reprojector object.

init()

Constructs a reprojector object. Not specifying any directives results in FME choosing a default engine based on the context, as well as what engines are licensed. If none are licensed, createReprojector() will throw an exception.

Returns: FMEReprojector

init(directives)

Constructs a reprojector object.

Parameters

Returns: FMEReprojector

Instance Methods [hide private]
 
__init__(MultipleInvocations)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
list of strings
getCoordinateSystems()
Get the coordinate systems being used.
string
getLastErrorMessage()
Retrieve the last error message if an exception had been raised internal to this class.
bool
nullReprojection()
Returns True if the reprojection will not alter coordinate values and False otherwise.
float
reprojectAngle(startX, startY, finishX, finishY)
This reprojects the angle of the given line, measured CCW from the horizontal, and returns the resulting angle in degrees.
list of tuples of floats
reprojectArray(xyzCoords)
This reprojects the given list of coordinates, and returns the results.
FMEFeature or None
reprojectFeature(feature)
This reprojects the given feature using the coordinate systems currently set.
Same type as input geometry.
reprojectGeometry(geometry)
This reprojects the given geometry using the coordinate systems currently set.
float
reprojectLength(startX, startY, finishX, finishY)
This reprojects the 2D length of the given line, returning the length in ground units.
None
setCoordinateSystems(sourceCS, destCS)
Set the coordinate systems being used.
bool
validCoordinateSystems()
Check if the currently set coordinate systems are valid.

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__

getCoordinateSystems()

 

Get the coordinate systems being used. If the coordinate systems are invalid or were not set, empty strings will be returned.

Returns: list of strings
The source coordinate system and destination coordinate system of the reprojector.

getLastErrorMessage()

 

Retrieve the last error message if an exception had been raised internal to this class. A blank string is returned if there was no previous error message.

Returns: string
The last error message.

nullReprojection()

 

Returns True if the reprojection will not alter coordinate values and False otherwise. For example, this might occur if either the source or destination coordinate system is non-earth.

Returns: bool
Whether or not the reprojection will alter coordinate values.

reprojectAngle(startX, startY, finishX, finishY)

 

This reprojects the angle of the given line, measured CCW from the horizontal, and returns the resulting angle in degrees. If the coordinate systems are not set or invalid, this will throw an exception, and the result will be set to the original angle.

Parameters:
  • startX (float) - The x coordinate of the starting point.
  • startY (float) - The Y coordinate of the starting point.
  • finishX (float) - The x coordinate of the starting point.
  • finishY (float) - The Y coordinate of the starting point.
Returns: float
The angle of the reprojection in degrees.
Raises:
  • FMEException - An exception is raised if an error occurred.

reprojectArray(xyzCoords)

 

This reprojects the given list of coordinates, and returns the results. This will throw an exception if the coordinate systems are not set or invalid, or if the reprojection cannot be completed.

Parameters:
  • xyzCoords (list of tuples of floats) - The list of coordinates. xyzCoords is a list of tuples in the form of [(x[0], y[0], z[0]), (x[1], ... , (x[n-1], y[n-1], z[n-1]) with n being the number of xyz coordinate tuples.
Returns: list of tuples of floats
The given result of the reprojection.
Raises:
  • FMEException - An exception is raised if an error occurred.

reprojectFeature(feature)

 

This reprojects the given feature using the coordinate systems currently set. This honours any pre-reproject functions set. If the feature has a source coordinate system set, it will be used instead of the source coordinate system set on the current reprojector. If None is passed in, None is returned.

Parameters:
  • feature (FMEFeature or None) - The feature to reproject.
Returns: FMEFeature or None
The input feature after reprojection.
Raises:
  • FMEException - An exception is raised if an error occurred.

reprojectGeometry(geometry)

 

This reprojects the given geometry using the coordinate systems currently set. The type of geometry returned may not be the same as the geometry given. For instance, if a FMEArc was given, a FMELine may be returned. This will throw an exception if the coordinate systems are not set or invalid, or if the reprojection cannot be completed. If None is passed in, None is returned.

Parameters:
  • geometry (FMEGeometry or None) - The geometry to reproject.
Returns: Same type as input geometry.
The input geometry after reprojection.
Raises:
  • FMEException - An exception is raised if an error occurred.

reprojectLength(startX, startY, finishX, finishY)

 

This reprojects the 2D length of the given line, returning the length in ground units. If the coordinate systems are not set or invalid, this will return an error, and results will be set to the original length.

Parameters:
  • startX (float) - The x coordinate of the starting point.
  • startY (float) - The y coordinate of the starting point.
  • finishX (float) - The x coordinate of the starting point.
  • finishY (float) - The y coordinate of the starting point.
Returns: float
The length of the reprojection in ground units.
Raises:
  • FMEException - An exception is raised if an error occurred.

setCoordinateSystems(sourceCS, destCS)

 

Set the coordinate systems being used. Will throw an exception if the coordinate systems cannot be set or are invalid.

Parameters:
  • sourceCS (string) - The source coordinate system to set.
  • destCS (string) - The destination coordinate system to set.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

validCoordinateSystems()

 

Check if the currently set coordinate systems are valid.

Returns: bool
Returns True if the coordinate systems are valid and False otherwise.