Skip to main content
Question

Python in FME

  • February 7, 2014
  • 2 replies
  • 29 views

parashari
Forum|alt.badge.img+2
I am trying to work on python script but not able to correctly get what exactly is required. I know how to use it in ArcGIS 10.0 (Xp machine). In ArcGIS, there are two options

 

a) Pre logic script code

 

d = {}

 

def find_duplicates (valX , valY):

 

d[( valX, valY)] = d.setdefault ( ( valX , valY) , -1) +1

 

return d[ ( valX , valY) ]

 

 

b)[Field_name] = 

 

find_duplicates ( [X_Coordina] , [Y_Coordina]

 

 

But here in FME that type of Scripting is not working. Can anyone help me with the same. I used PythonCaller, PythonCreator, but didn't get the expected result. Is it possible to write ArcGIS type of python Scripting in FME?

 

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.

2 replies

takashi
Celebrity
  • February 7, 2014
Hi,

 

 

Definition of "find_duplicates" looks like standard Python code, but the 2nd code maybe is ArcGIS specific style.

 

I think you can achieve your purpose after reading these articles.

 

http://fmepedia.safe.com/articles/How_To/Python-and-FME-Basics

 

http://fmepedia.safe.com/articles/How_To/New-Python-FME-Objects-API-in-FME-2012

 

 

If any question would remain after learning them, let us know again.

 

 

Takashi

takashi
Celebrity
  • February 8, 2014
BTW, it seems that the Matcher and the Counter can do the same thing.

 

If there is not specific reason for using Python script, use Transformers. That's the FME style, I think :-)