Skip to main content

Hello,

 

How can I add the elevation as 3rd dimension to existing segment?

I have the elevation values for the starting and ending points of each segment.

 

Thanks

Hi @arthy, take a look at the 3DInterpolator transformer.


Hi @arthy, take a look at the 3DInterpolator transformer.

@takashi

Let's say I have a segment with boundary A(x1,y1,0) and B(x2,y2,0) and I have the information z1 and z2.

How to proceed to modify the geometry of that segment such that the boundary will be A(x1,y1,z1) and B(x2,y2,z2). For now, I don't rellay want to interpolate the 3rd dimension between A and B.


Hi @arthy, take a look at the 3DInterpolator transformer.

Is the geometry type of the segment feature is line?

Does the segment feature have the elevation information as its attributes?


Hi @arthy,

I'd avice you to do as follows:

  1. assign unique IDs to your segments by the Counter,
  2. then chop them to vertices by a Chopper,
  3. assign IDs to every vertex by a Counter and
  4. then adjust height of your vertices accordingly. For example you could obtain Z-position of your control points and transfer them to your segment vertices by a NeighborFinder.
  5. Once the Z-Attribute has been transferred push the vertex into this position by help of 3DForcer and
  6. than use a Sorter to rearrange correct order of your data.
  7. By help of PointConnector and separation attribute of your segmentID you will receive the initial features but now with 3D coordinates.

Hope this helps!


Is the geometry type of the segment feature is line?

Does the segment feature have the elevation information as its attributes?

No.

 

It was coming from another source

Hi @arthy,

I'd avice you to do as follows:

  1. assign unique IDs to your segments by the Counter, 
  2. then chop them to vertices by a Chopper, 
  3. assign IDs to every vertex by a Counter and 
  4. then adjust height of your vertices accordingly. For example you could obtain Z-position of your control points and transfer them to your segment vertices by a NeighborFinder. 
  5. Once the Z-Attribute has been transferred push the vertex into this position by help of 3DForcer and 
  6. than use a Sorter to rearrange correct order of your data. 
  7. By help of PointConnector and separation attribute of your segmentID you will receive the initial features but now with 3D coordinates.

Hope this helps!

@whkarto

Thanks for your answer.

I finally used a pythoncaller which give the desired solution in a few lines.

coord = feature.getAllCoordinates()
n=len(coord)
coordi0]=(coordd0]i0],coordu0]o1],z1)
coordnn-1]=(coord>n-1]e0],coord=n-1]a1],z2)

 


Hi @arthy, take a look at the 3DInterpolator transformer.

Two pairs of the CoordinateExtractor (Mode: Specify Coordinate) and the VertexCreator (Mode: Replace Point At Index) do the trick, after you merged z1 and z2 to the segment feature.


Two pairs of the CoordinateExtractor (Mode: Specify Coordinate) and the VertexCreator (Mode: Replace Point At Index) do the trick, after you merged z1 and z2 to the segment feature.

As I explained to @whkarto above, I used a python caller to do that.

It was more simple.

 

Thanks for your help


Reply