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

Class FMECoordSysManager


init()

FME Coordinate System Manager class.

This class provides provides the ability to retrieve and define coordinate system information: projections, datums, ellipsoids, and units.

Instance Methods [hide private]
 
__init__()
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
string
defineCoordSys(coordSysParms)
Provides a name for a coordinate system defined by the parameters passed in.
None
defineCoordSysFromFeature(coordSysFeature)
Defines the coordinate system from the passed in feature.
string
defineCoordSysFromOGCDef(ogcDef, coordSysName)
Defines a coord system based on the OGC definition passed in.
None
defineDatum(datumName, datumParams)
Defines a datum based on the parameters passed in.
None
defineEllipsoid(ellipsoidName, ellipsoidParams)
Defines a ellipsoid based on the parameters passed in.
None
defineUnit(unitName, unitParams)
Defines a unit based on the parameters passed in.
string
getCoordSysAsOGCDef(coordSysName, ogcDef)
Gets the OGC definition of the coordinate system whose name is passed in.
list of strings or None
getCoordSysList()
Retrieves the list of all supported coordinate system names.
string or None
getCoordSysNameFromPrjFile(prjFileName)
Returns a coord system name for the coordinate system represented by the contents of the .prj filename passed in The file is taken to hold an ESRI Well Known Text (WKT) representation of a coordinate system definition.
list of strings
getCoordSysParms(coordSysName)
Returns the parameters associated with the coordinate system name in the pairwise 'coordSysParms' array.
FMEFeature
getCoordSysParmsAsFeature(coordSysName)
Retrieves the specified coordinate system and stores its definition in a returned feature.
list of strings
getDatumParms(datumName)
Gets the definition of the datum whose name is passed in.
list of strings
getEllipsoidParms(ellipsoidName)
Gets the definition of the ellipsoid whose name is passed in.
list of strings
getUnitParms(unitName)
Gets the definition of the unit whose name is passed in.
list of strings
getUserCoordSysDefFiles()
Returns a list of all the files that coordinate system defs should be read from.
None
readDefsFromFile(fileName)
Reads definitions for Coordinate systems, Datums, Ellipsoids, and Units from the specified file.
string
reprojectDirectory()
Return the directory where the reprojection subsystem support files live.
None
writePrjFile(prjFileName, coordSysName)
Writes a .prj file containing the ESRI Well Known Text representation of the coord system name passed in .

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__()
(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__

defineCoordSys(coordSysParms)

 

Provides a name for a coordinate system defined by the parameters passed in. A new coordinate system is defined only if the coordinate system did not already exist under a previous name.

Parameters:
  • coordSysParms (list of strings or dict of strings) - A pairwise array of FME Coordinate system parameters, and their values. (i.e. entry 0 is a FME coordinate system parameter keyword, as defined in the coordinate systems section of the FME Reference Manual, and entry 1 is its value. Entry 2 is the parameter name, entry 3 its value, and so on. There MUST be an even number of parameters in the 'coordSysParms' array.
Returns: string
A name that is unique to the coordinate system.
Raises:
  • FMEException - An FMEException is raised if there was an error.

defineCoordSysFromFeature(coordSysFeature)

 

Defines the coordinate system from the passed in feature.

Parameters:
Returns: None
Raises:
  • FMEException - An FMEException is raised if there was an error.

defineCoordSysFromOGCDef(ogcDef, coordSysName)

 

Defines a coord system based on the OGC definition passed in.

Parameters:
  • ogcDef (string) - The OGC definition the coordinate system is defined from.
  • coordSysName (string) - The coordSysName is a parameter that takes in the following hint constants that define the form of the OGC definition.
    • ESRI: Translate ESRI style to standard first, before getting a FME name,
    • AUTODESK: Use the autodesk WKT exceptions file first before trying automated WKT conversion,
    • EPSG: Translate an EPSG code to FME (needs some support files to operate),
    • MAPINFO: Convert a MapInfo coordinate system string (held in the ogcDef string) to a FME name,
    • PROJ4: Translate a PROJ.4 string to FME,
    • ORACLE: Use the Oracle SRID to FME name exceptions file (an SRID code is excepted in the ogcDef parameter.
Returns: string
The name of the coordinate system that can be used within FME. If the source representation does not have a FME representation (but no errors occur) the return value will bean empty string. This could occur, for example, when no mapping exists between an Oracle SRID and a FME coordinate system.
Raises:
  • FMEException - An FMEException is raised if there was an error.

defineDatum(datumName, datumParams)

 

Defines a datum based on the parameters passed in. The datum definition is only validated on first use. If the datum was already defined, the new definition replaces the old one and no error is returned. To find out if the datum already existed, the getDatumParms call below can be used.

Parameters:
  • datumName (string) - The name that the datum can be referred to by later in coordinate system definitions.
  • datumParams (list of strings or dict of strings) - A list of pairwise datum definition parameters, and their values. (i.e. entry 0 is a datum definition keyword, as defined in the coordinate systems section of the FME Reference Manual section 8.6.1, and entry 1 is its value. Entry 2 is the parameter name, entry 3 its value, and so on. There MUST be an even number of parameters.
Returns: None
Raises:
  • FMEException - An FMEException is raised if there was an error.

defineEllipsoid(ellipsoidName, ellipsoidParams)

 

Defines a ellipsoid based on the parameters passed in. The ellipsoid definition is only validated on first use. If the ellipsoid was already defined, the new definition replaces the old one and no error is returned. To find out if the ellipsoid already existed, the getEllipsoidParms call below can be used.

Parameters:
  • ellipsoidName (string) - The name that the ellipsoid can be referred to by later in coordinate system definitions.
  • ellipsoidParams (list of strings or dict of strings) - A pairwise list of ellipsoid definition parameters, and their values.(i.e. entry 0 is an ellipsoid definition keyword, as defined in the coordinate systems section of the FME Reference Manual section 8.7.1, and entry 1 is its value. and entry 1 is its value. Entry 2 is the parameter name, entry 3 its value, and so on. There MUST be an even number of parameters.
Returns: None
Raises:
  • FMEException - An FMEException is raised if there was an error.

defineUnit(unitName, unitParams)

 

Defines a unit based on the parameters passed in. The unit definition is only validated on first use. If the unit was already defined, the new definition replaces the old one and no error is returned. To find out if the unit already existed, the getUnitParms call below can be used.

Parameters:
  • unitName (string) - The name that the unit can be referred to by later in coordinate system definitions.
  • unitParams (list of strings or dict of strings) - A pairwise list of unit definition parameters, and their values. (i.e. entry 0 is a FME unit definition keyword, as defined in the coordinate systems section of the FME Reference Manual section 8.7.1, and entry 1 is its value. Entry 2 is the parameter name, entry 3 its value, and so on. There MUST be an even number of parameters.
Returns: None
Raises:
  • FMEException - An FMEException is raised if there was an error.

getCoordSysAsOGCDef(coordSysName, ogcDef)

 

Gets the OGC definition of the coordinate system whose name is passed in.

Parameters:
  • coordSysName (string) - The name of the coordinate system the ogc definition is being retrieved for.
  • ogcDef (string) - The 'ogcDef' parameter takes in the following hint constants that define the form of the OGC definition.
    • ESRI: Translate to ESRI WKT format,
    • AUTODESK:Use the autodesk WKT exceptions file first before trying automated WKT conversion,
    • EPSG: Translate a FME name to an EPSG SRID code (which is also not OGC WKT at all),
    • MAPINFO: Convert a FME name to a MapInfo coordinate system string (which is also not OGC WKT at all),
    • PROJ4: Translate to a PROJ.4 string (not really OGC WKT at all of course),
    • ORACLE: Translate a FME name to an Oracle SRID code (which is also not OGC WKT at all),
    • PrettyWKT: Translate to nicely formatted WKT that is easier to read,
    • SimplifiedPrettyWKT: WKT, but strip out some of the useless stuff like AXIS definitions,
    • WKT1: Same as regular WKT but strip all parameters not listed in the Simple Features for SQL specification. This is needed for MapGuide for instance.
Returns: string
The target representation for the coordinate system. If the coordinate system does not have a target representation (but no errors occur) the return value will be set to an empty string. This could occur, for example, when no mapping exists between an Oracle SRID and a FME coordinate system.
Raises:
  • FMEException - An exception is raised if an error occurred.

getCoordSysList()

 

Retrieves the list of all supported coordinate system names.

Returns: list of strings or None
The list of all supported coordinate system names.
Raises:
  • FMEException - An exception is raised if an error occurred.

getCoordSysNameFromPrjFile(prjFileName)

 

Returns a coord system name for the coordinate system represented by the contents of the .prj filename passed in The file is taken to hold an ESRI Well Known Text (WKT) representation of a coordinate system definition.

Parameters:
  • prjFileName (string) - The name of the .prj that contains the representation of the coordinate system. or blank if any problems or errors occurred in retrieving the coordinate system from the file.
Returns: string or None
The unique name of the coordinate system that can be used within FME, or blank if any problems or errors occurred in retrieving the coordinate system from the file.

getCoordSysParms(coordSysName)

 

Returns the parameters associated with the coordinate system name in the pairwise 'coordSysParms' array.

Parameters:
  • coordSysName (string) - The name of the coordinate system the parameters are being retrieved for.
Returns: list of strings
Returns a pairwise list containing the parameters of the named coordinate system.
Raises:
  • FMEException - An exception is raised if an error occurred or the coordinate system could not be retrieved.

getCoordSysParmsAsFeature(coordSysName)

 

Retrieves the specified coordinate system and stores its definition in a returned feature.

Parameters:
  • coordSysName (string) - The name of the coordinate system the parameters are being retrieved for.
Returns: FMEFeature
The FMEFeature the coordinate system definition is being stored in.
Raises:
  • FMEException - An exception is raised if an error occurred.

getDatumParms(datumName)

 

Gets the definition of the datum whose name is passed in.

Parameters:
  • datumName (string) - The name of the datum the parameters are being retrieved for.
Returns: list of strings
The list storing the datum parameters. If no such datum exists, then an empty list is returned.
Raises:
  • FMEException - An exception is raised if an error occurred.

getEllipsoidParms(ellipsoidName)

 

Gets the definition of the ellipsoid whose name is passed in.

Parameters:
  • ellipsoidName (string) - The name of the ellipsoid the parameters are being retrieved for.
Returns: list of strings
The list storing the ellipsoid parameters. If no such ellipsoid exists, then an empty list is returned.
Raises:
  • FMEException - An exception is raised if an error occurred.

getUnitParms(unitName)

 

Gets the definition of the unit whose name is passed in.

Parameters:
  • unitName (string) - The name of the unit the parameters are being retrieved for.
Returns: list of strings
The list storing the unit parameters. If no such unit exists, then an empty list is returned.
Raises:
  • FMEException - An exception is raised if an error occurred.

getUserCoordSysDefFiles()

 

Returns a list of all the files that coordinate system defs should be read from.

Returns: list of strings
List of files that coordinates system definitions should be read from.
Raises:
  • FMEException - An exception is raised if an error occurred.

readDefsFromFile(fileName)

 

Reads definitions for Coordinate systems, Datums, Ellipsoids, and Units from the specified file. If the file cannot be found or there is an invalid definition then an error code is returned.

Parameters:
  • fileName (string) - The name of the file the definition is read from.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.

reprojectDirectory()

 

Return the directory where the reprojection subsystem support files live. Typically this is in FME_HOME/Reproject, but this call should be used to obtain it. FME_HOME can be obtained from the mapping file object using the normal 'fetch' call.

Returns: string
The directory where the reprojection subsystem support files live.

writePrjFile(prjFileName, coordSysName)

 

Writes a .prj file containing the ESRI Well Known Text representation of the coord system name passed in .

Parameters:
  • prjFileName (string) - The name of destination file the representation of the coordinate system will be written to.
  • coordSysName (string) - The name of the coordinate system.
Returns: None
Raises:
  • FMEException - An exception is raised if an error occurred.