Skip to main content

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

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


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


HI,

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

 


Reply