fmeobjects.FMELibrary

Inheritance diagram of fmeobjects.FMELibrary

FMELibrary.addAppearance(appearance)

This routine adds the appearance object to the Library.

FMELibrary.addGeometryDefinition(geometryDef)

This routine adds the Geometry Definition object to the Library.

FMELibrary.addTexture(texture)

This routine adds the Texture object to the Library.

FMELibrary.deleteAppearance(appearanceReference)

Deletes the appearance with the 'appearanceReference' index.

FMELibrary.deleteGeometryDefinition(...)

Deletes the Geometry Definition with the 'geometryDefinitionReference' index.

FMELibrary.deleteTexture(textureReference)

Deletes the Texture with the 'textureReference' index.

FMELibrary.getAppearanceCopy(appearanceReference)

This routine returns a copy of the referenced Appearance object from the Library.

FMELibrary.getGeometryDefinitionCopy

getGeometryDefinitionCopy(geometryDefinitionReference),

FMELibrary.getTextureCopy(textureReference)

This routine returns a copy of the referenced Texture object from the Library.

FMELibrary.hasEntry(reference)

Returns True if the library has an object with the specified reference number.

FMELibrary.hasType

hasType(reference),

FMELibrary.replaceAppearance(...)

Replaces the Appearance with a new one at index = 'appearanceReference'.

FMELibrary.replaceGeometryDefinition(...)

Replaces the GeometryDefinition with a new one at index = 'geometryDefinitionReference'.

FMELibrary.replaceTexture(textureReference, ...)

Replaces the Texture with a new one at index = 'textureReference'.

class FMELibrary

FME Library Class

init()

Contains shared objects used by multiple features. Appearances and textures for all features are stored in this library.

__init__(*args, **kwargs)
addAppearance(appearance)

This routine adds the appearance object to the Library. (If the appearance passed in is None, this appearance is will not be added to the Library.) There is no checking for duplicates when adding an appearance. This call will always add the appearance to the Library, even if an identical appearance already exists therein. If the addition is successful, the method returns a unique appearance reference ‘key’ that is associated with the appearance. If there are any errors in operation, an exception is raised. If the appearance is successfully added to the library, the library consumes the appearance.

Parameters

appearance (FMEAppearance) – The appearance object that will be added to the library.

Return type

int

Returns

The unique appearance reference ‘key’.

Raises

FMEException – An exception is raised if an error occurred.

addGeometryDefinition(geometryDef)

This routine adds the Geometry Definition object to the Library. (If the Geometry Definition passed in is None, this Geometry Definition will not be added to the Library.) There is no checking for duplicates when adding a Geometry Definition. This call will always add the Geometry Definition to the Library, even if an identical one already exists therein. If there are any errors in operation an exception is raised. If the addition is successful, a unique geometry definition reference ‘key’ that is associated with the Geometry Definition is returned.

Parameters

geometryDef (FMEGeometry) – The geometry definition object that will be added to the library.

Return type

int

Returns

The unique geometry definition reference ‘key’.

Raises

FMEException – An exception is raised if an error occurred.

addTexture(texture)

This routine adds the Texture object to the Library. (If the Texture passed in is None, this Texture is will not be added to the Library.) There is no checking for duplicates when adding a Texture. This call will always add the Texture to the Library, even if an identical Texture already exists therein. If addition is successful, a unique texture reference ‘key’ that is associated with the Texture is returned. If there are any errors in operation, an exception is raised. If the texture is successfully added to the library, the library consumes the texture.

Parameters

texture (FMETexture) – The texture object that will be added to the library.

Return type

int

Returns

The unique texture reference ‘key’.

Raises

FMEException – An exception is raised if an error occurred.

deleteAppearance(appearanceReference)

Deletes the appearance with the ‘appearanceReference’ index. Throws an exception if the current shared object is not of appearance type.

Parameters

appearanceReference (int) – The ‘appearanceReference’ index of the appearance to be deleted from the library.

Return type

None

Raises

FMEException – An exception is raised if an error occurred.

deleteGeometryDefinition(geometryDefinitionReference)

Deletes the Geometry Definition with the ‘geometryDefinitionReference’ index. Throws an exception if the current shared object is not of geometry definition type.

Parameters

geometryDefinitionReference (int) – The ‘geometryDefinitionReference’ index of the appearance to be deleted from the library.

Return type

None

Raises

FMEException – An exception is raised if an error occurred.

deleteTexture(textureReference)

Deletes the Texture with the ‘textureReference’ index. Throws an exception if the current shared object is not of texture type.

Parameters

textureReference (int) – The ‘textureReference’ index of the appearance to be deleted from the library.

Return type

None

Raises

FMEException – An exception is raised if an error occurred.

getAppearanceCopy(appearanceReference)

This routine returns a copy of the referenced Appearance object from the Library. If there is no such Appearance in the Library, None is returned.

Parameters

appearanceReference (int) – The appearance Reference.

Return type

FMEAppearance or None

Returns

The appearance copy or None.

getGeometryDefinitionCopy()

getGeometryDefinitionCopy(geometryDefinitionReference),

This routine returns a copy of the referenced Geometry Definition object from the Library. If there is no such Geometry Definition in the Library, None is returned.

Parameters

geometryDefinitionReference (int) – The Geometry Definition Reference.

Return type

FMEGeometry or None

Returns

The geometry definition or None.

getTextureCopy(textureReference)

This routine returns a copy of the referenced Texture object from the Library. If there is no such Texture in the Library, None is returned.

Parameters

textureReference (int) – The texture Reference.

Return type

FMETexture or None

Returns

The texture or None.

hasEntry(reference)

Returns True if the library has an object with the specified reference number.

Parameters

reference (int) – The reference to search the library for.

Return type

bool

Returns

Returns True if the library has an object with the specified reference number, or False otherwise.

hasType()

hasType(reference),

Returns the Library Type (FME_LIB_APPEARANCE, FME_LIB_TEXTURE, FME_LIB_RASTER, or FME_LIB_GEOMETRY_DEFINITION) if library has an object with the specified reference number. Throws an exception if the supplied reference refers to an object without a valid object type, or if there is no object within the Library with the supplied reference number. Use hasEntry() to determine if the library contains the specified reference.

Parameters

reference (int) – The reference to search the library for.

Return type

int

Returns

If the library has an object with the specified reference number the Library Type (FME_LIB_APPEARANCE, FME_LIB_TEXTURE, FME_LIB_RASTER, or FME_LIB_GEOMETRY_DEFINITION) is returned, otherwise an exception is thrown.

Raises

FMEException – An exception is raised if an error occurred.

replaceAppearance(appearanceReference, newAppearance)

Replaces the Appearance with a new one at index = ‘appearanceReference’. A FMEException is thrown if ‘newAppearance’ is None, ‘appearanceReference’ is not a valid index ,or the existing shared object is not an appearance type. If the ‘newAppearance’ successfully replaces the existing appearance, the library consumes the ‘newAppearance’.

Parameters
  • appearanceReference (int) – The index of the Appearance to replace.

  • newAppearance (FMEAppearance) – The new appearance to replace the original with.

Return type

None

Raises

FMEException – An exception is raised if an error occurred.

replaceGeometryDefinition(geometryDefinitionReference, newGeometryDefinition)

Replaces the GeometryDefinition with a new one at index = ‘geometryDefinitionReference’. A FMEException is thrown if ‘newGeometryDefinition’ is None, ‘geometryDefinitionReference’ is not a valid index or the existing shared object is not a geometry definition type.

Parameters
  • geometryDefinitionReference (int) – The index of the geometry to replace.

  • newGeometryDefinition (FMEGeometry) – The new geometry definition to replace the original with.

Return type

None

Raises

FMEException – An exception is raised if an error occurred.

replaceTexture(textureReference, newTexture)

Replaces the Texture with a new one at index = ‘textureReference’. A FMEException is thrown if ‘newTexture’ is None, ‘textureReference’ is not a valid index or the existing shared object is not an texture type. If the ‘newTexture’ successfully replaces the existing texture, the library consumes the ‘newTexture’.

Parameters
  • textureReference (int) – The index of the Texture to replace.

  • newTexture (FMETexture) – The new texture to replace the original with.

Return type

None

Raises

FMEException – An exception is raised if an error occurred.