The PythonCaller can only process a single feature at a time. If you need to process more than one feature, you can e.g. use a FeatureMerger first to assemble a single feature with all the necessary information before sending it to the PythonCaller.
Also, you need to wrap the code in either a function or a class instance, see
https://knowledge.safe.com/articles/60319/pythoncaller-transformer.html
Hi @david_r. Thanks for the reply. But since I am totally unaware of how python script works. I am not able to execute what you are saying. I thought i just need to join two feature class and copy the script from arcpy. Is there any possibility of elaborating the answer if you are aware of Snap_edit function in ArcGIS.
@david_r
..erhmm
the link you posted quickly reveals that "..process one feature at a time or a class where you may want to do things to groups of features. The PythonCaller.."
You could use the SnappingFactory in a Pythoncaller. (not licensed for base edition I read here..)
and be done with arcpy.
@david_r
..erhmm
the link you posted quickly reveals that "..process one feature at a time or a class where you may want to do things to groups of features. The PythonCaller.."
I think the keyword here is the first few words of the post: "I am very new to python" ;-)
But yeah, anything's possible with Python.
You could use the SnappingFactory in a Pythoncaller. (not licensed for base edition I read here..)
and be done with arcpy.
Or just simply skip Python altoghether and use the Snapper / AnchoredSnapper.
As I responded to @gio, is there a particular reason for using Python / arcpy at all here? Have you considered using the Snapper (or AnchoredSnapper) transformers in FME?
As I responded to @gio, is there a particular reason for using Python / arcpy at all here? Have you considered using the Snapper (or AnchoredSnapper) transformers in FME?
I agree with @david_r regarding use of python. (Apart form the fact that I prefer tcl).
Personally I always try to solve problems using transformers, keeping snakes and tools at bay.
But I also answered the question in which @mukhtar_gf seems intent on using python.
But yeah do you need to?
Obviously not, so I'd go with David's advise and go pure transformers (unless you want to learn python and fme objects etc. in the process)