Skip to main content
Question

Python caller help - callculating a field

  • April 15, 2020
  • 3 replies
  • 8 views

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

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.

3 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • 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
Celebrity
  • 7843 replies
  • 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
  • 17 replies
  • 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.