Skip to main content
Solved

Set Z values


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor

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).
View original
Did this help you find an answer to your question?

3 replies

geosander
Forum|alt.badge.img+7
  • 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+28
  • Author
  • Contributor
  • July 23, 2018
geosander wrote:

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
Influencer
  • 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).

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