Skip to main content
Solved

1st parameter `XZJ' is not a floating point number

  • December 15, 2019
  • 1 reply
  • 9 views

charry
Supporter
Forum|alt.badge.img+5

Execution error? 1st parameter `XZJ' is not a floating point number?BUT I can't XZJ type

Best answer by takashi

Hi @charry, the performFunction method requires a string representing a complete FME function call as its parameter. If the FME function (@Rotate2D in your case) requires a numeric value as a parameter, it should be a numeric representation, should not be any attribute name (string).

e.g.

    feature.performFunction('@Rotate2D(45,0,0)')

 

If you want to pass feature attribute values to the FME function, you will have to build the FME function call string containing appropriate values as formatted strings.

e.g.

    a = float(feature.getAttribute('_angle'))
    x = float(feature.getAttribute('_x'))
    y = float(feature.getAttribute('_y'))
    feature.performFunction('@Rotate2D(%f,%f,%f)' % (a, x, y))

 

By the way, why not use the Rotator transformer?

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.

1 reply

takashi
Celebrity
  • Best Answer
  • December 15, 2019

Hi @charry, the performFunction method requires a string representing a complete FME function call as its parameter. If the FME function (@Rotate2D in your case) requires a numeric value as a parameter, it should be a numeric representation, should not be any attribute name (string).

e.g.

    feature.performFunction('@Rotate2D(45,0,0)')

 

If you want to pass feature attribute values to the FME function, you will have to build the FME function call string containing appropriate values as formatted strings.

e.g.

    a = float(feature.getAttribute('_angle'))
    x = float(feature.getAttribute('_x'))
    y = float(feature.getAttribute('_y'))
    feature.performFunction('@Rotate2D(%f,%f,%f)' % (a, x, y))

 

By the way, why not use the Rotator transformer?