I have two polyline features. One which is on the ground surface and one below the ground surface on the exact same location. I want to generate height lines for each Vertex generated by the differences in Z-coordinates of the corresponding vertices of the 2 polyline features.
Solved
How to generate height lines with the same X, Y only in the third dimension using differences in Z coordinates?
Best answer by markatsafe
@sibe For each line, you can use CoordinateConcatenator to generate a comma separated list of the Z values and then use AttributeSplitter to generate a list attribute. Aggregate the two lines. You can the pass the two list attributes into a short PythonCaller script - something along the lines off:
import fme
import fmeobjects
def processFeature(feature):
# initialize the python lists with FME lists
_Z1 = feature.getAttribute('_Z1{}')
_Z2 = feature.getAttribute('_Z2{}')
_diffZ = []
for i in range(len(_Z2)):
_diff = float(_Z2[i]) - float(_Z1[i])
_diffZ.append(_diff)
# output the FME lists
feature.setAttribute('_diffZ{}', _diffZ)
Force the Geometry to 2D (2DForcer) and then use FMEFunctionCaller to call:
@ZValue(_diffZ{})
as described by @Takashi Iijima here. For this to work your vertices have to line up, so you might have to use Intersector or Snapper before hand
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.