Skip to main content
Question

Add 3rd dimension on segment


arthy
Contributor
Forum|alt.badge.img+8
  • Contributor

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

8 replies

takashi
Supporter
  • November 9, 2018

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


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • November 9, 2018
takashi wrote:

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.


takashi
Supporter
  • November 9, 2018
takashi wrote:

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?


whkarto
Contributor
Forum|alt.badge.img+14
  • Contributor
  • November 9, 2018

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!


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • November 9, 2018
takashi wrote:

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

arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • November 9, 2018
whkarto wrote:

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)
coord[0]=(coord[0][0],coord[0][1],z1)
coord[n-1]=(coord[n-1][0],coord[n-1][1],z2)

 


takashi
Supporter
  • November 11, 2018
takashi wrote:

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.


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • November 13, 2018
takashi wrote:

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


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