Skip to main content
Question

Python caller help - callculating a field


Forum|alt.badge.img+1

Hi guys,

in Arcmap i usualy calculate a attribute/field value "Vertices", where are noted numbers of vertices on polyline feature. I do it with Python phraser and simple code: !shape!.pointcount.

 

Can be this field value calculated via fmes Python caller and how?

 

Thanks in advance for any help or other solutuion.

Bye, Miha

3 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • April 15, 2020

There is an FME transformer VertexCounter which will count the number of vertices. If your data contains arcs however, I don't think this gives you the same result as what would be returned in ArcMap so something to be aware of

https://knowledge.safe.com/questions/90750/vertexcounter-transformer-giving-incorrect-vertex.html


takashi
Influencer
  • April 15, 2020

I agree that using the VertexCounter transformer is easier than writing Python script, but if there is a specific reason for using PythonCaller, you can use the numVertices method of FMEFeature class.

See the Python FME Objects API Reference to learn more.

http://docs.safe.com/fme/html/fmepython/api/fmeobjects/index.html

http://docs.safe.com/fme/html/fmepython/api/fmeobjects/_feature/fmeobjects.FMEFeature.numVertices.html#fmeobjects.FMEFeature.numVertices


Forum|alt.badge.img+1
  • Author
  • April 16, 2020

HI,

Thanks again for your opinion and requested literature. I will try to use vertex creator and than statistics calculator instead of python caller.

 


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