Skip to main content
Question

Using <Auto> in a scripted parameter

  • August 9, 2022
  • 1 reply
  • 4 views

pflegpet
Contributor
Forum|alt.badge.img+8

Hi, 

Im trying to write a scripted parameter to allow only specified EPSG codes from the CsmapReprojector and apply the correct transformation . Based on a chosen source and destination CRS selected by the user a certain transformation is applied. This works fine, except when I try to use the <Auto> parameter. According to the documentation I should "Use the alternative blank string and NULL_FME respectively when passing in as an attribute." Unfortunately when I use "" as blank string in my script, the workspace fails because "Parameter 'TRANSFORMATION' must be given a value."

 

So how do I pass a "blank string" that triggers the automatic transformation in CsmapReprojector? My script looks something like this:

 

import fme

 

if fme.macroValues['SOURCE_CRS'] == 'EPSG:25833' and fme.macroValues['DEST_CRS'] == 'EPSG:31468':

  return 'DHDN_to_ETRS89/01_local_grid_FME (Reversed)'

else:

  return ""

 

Thank you for your help!

 

1 reply

pflegpet
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • August 9, 2022

I found the solution - I had to uncheck the "Required" checkbox in the parameter options. Now I can pass an empty string in the script to trigger the automatic transformation.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings