As part of a configuration validation process I need to check if the list of coordinate system options retrieved from an external list are defined in the instance of FME running the validation workbench. This validation process needs to work with both inbuilt and custom projections that have been defined. My configuration list is based on the FME name of the projection (i.e. for custom projections, matching the attribute COORDINATE_SYSTEM_DEF). Is there a way to read all currently defined coordinate systems to check if the items in the list exist?
Solved
FME Reader to retrieve all defined coordinate systems
Best answer by daveatsafe
Hi @jstanger,
Please use a PythonCaller, with the following code:
import fme
import fmeobjects
def testCoordsys(feature):
testCoordsys = feature.getCoordSys()
coordsysManager = fmeobjects.FMECoordSysManager()
allCoordsys = coordsysManager.getCoordSysList()
if testCoordsys in allCoordsys:
feature.setAttribute('_valid_coordsys', 'yes')
else:
feature.setAttribute('_valid_coordsys', 'no')
In the PythonCaller, you will need to expose the new _valid_coordsys attribute to make it visible to Workbench.

After the PythonCaller, you can use a Tester to route the features based on the value of _valid_coordsys.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.



