Skip to main content
Solved

Set Z values

  • July 23, 2018
  • 3 replies
  • 748 views

jdh
Contributor
Forum|alt.badge.img+36
  • Contributor
  • 2001 replies

Is there a way to set different Z values for each vertex of a line/polygon from a list, like the MeasureSetter in Whole Line/Area mode?

 

 

The 3DForcer sets all the vertices to a single elevation, and the VertexCreator replace point at vertex i only does one vertex at a time.

 

Best answer by takashi

Hi @jdh, you can call the @ZValue function (one of FME Feature Functions) with the FMEFunctionCaller. Assuming that the "_list{}" contains z values for the line/polygon:

@ZValue(_list{})

Notes:

  • Input geometry should be 2D.
  • The number of list elements should be exactly equal to the number of geometry coordinates.
  • If the input geometry type is polygon, the last element of the list should be equal to the first element (i.e. the resulting vertices should be closed in 3D).
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

geosander
Forum|alt.badge.img+7
  • 327 replies
  • July 23, 2018

Hi @jdh,

Personally, I'd do it in a PythonCaller/Creator, but using transformers, you could try the VertexExtractor from FME Hub perhaps? Then join the Z values in your list (based on the vertex id and some line/polygon break attribute), set the height using the 3DForcer and reassemble the lines/polygons using a PointConnector (but use the Sorter first)?


jdh
Contributor
Forum|alt.badge.img+36
  • Author
  • Contributor
  • 2001 replies
  • July 23, 2018

Hi @jdh,

Personally, I'd do it in a PythonCaller/Creator, but using transformers, you could try the VertexExtractor from FME Hub perhaps? Then join the Z values in your list (based on the vertex id and some line/polygon break attribute), set the height using the 3DForcer and reassemble the lines/polygons using a PointConnector (but use the Sorter first)?

I've done it in Python before, but most of my colleagues are not comfortable with Python.

 

 


takashi
Celebrity
  • 7842 replies
  • Best Answer
  • July 23, 2018

Hi @jdh, you can call the @ZValue function (one of FME Feature Functions) with the FMEFunctionCaller. Assuming that the "_list{}" contains z values for the line/polygon:

@ZValue(_list{})

Notes:

  • Input geometry should be 2D.
  • The number of list elements should be exactly equal to the number of geometry coordinates.
  • If the input geometry type is polygon, the last element of the list should be equal to the first element (i.e. the resulting vertices should be closed in 3D).