Skip to main content
Solved

2D points with elevation interval to 3D lines

  • December 13, 2019
  • 4 replies
  • 79 views

fikusas
Contributor
Forum|alt.badge.img+5

How this can be achieved in FME?

https://support.esri.com/en/technical-article/000011817

Source data – 2D point geometry with attributes 'FROM' and 'TO' (elevation values stored). The goal is to create 3D lines from those values.

Best answer by nielsgerrits

One way to do this is to use a GeometryReplacer.

2D points with elevation interval to 3D lines (2019.1.2).fmwt

0684Q00000ArLWDQA3.png

Set the Geometry Encoding to FME XML:

0684Q00000ArLmKQAV.png

Enter the following XML:

<?xml version="1.0" encoding="US_ASCII" standalone="no" ?>
<geometry>
    <line>
        <coord x="@XValue()" y="@YValue()" z="@Value(From)"/>
        <coord x="@XValue()" y="@YValue()" z="@Value(To)"/>
    </line>
</geometry>

Result:

0684Q00000ArLgqQAF.png

The way to find this is to use a Creator to create a sample geometry, for example a 3D line. 

0684Q00000ArLmnQAF.png

Then go to the XML tab to find the FME XML.

0684Q00000ArLmjQAF.png

Then replace the coordinates with placeholders.

View original
Did this help you find an answer to your question?

4 replies

bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • December 13, 2019

Assign Unique Row ID if there isn't one already: Use Counter.

Send it first to VertexCreator:

  • Mode: Replace with Point
  • X: @XCoord()
  • Y: @YCoord()
  • Z: The "FROM" Attribute

Then send to another VertexCreator, and do the same with the "TO" Attribute. The result of both VertexCreators is transforming the 2D From and To Points to 3D Points

Pipe both of the VertexCreator's Output Ports to a LineBuilder

  • Create the 3D lines from the now 3D Points by setting the "Connection Break Attribute" to the Unique Row ID / Counter Attribute

Depending on your Feature Order control in the Workspace, you may first need to put it through a Sorter to make sure it is ordered by From Points first, and To Points second entering LineBuilder.

 


nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • December 13, 2019

One way to do this is to use a GeometryReplacer.

2D points with elevation interval to 3D lines (2019.1.2).fmwt

0684Q00000ArLWDQA3.png

Set the Geometry Encoding to FME XML:

0684Q00000ArLmKQAV.png

Enter the following XML:

<?xml version="1.0" encoding="US_ASCII" standalone="no" ?>
<geometry>
    <line>
        <coord x="@XValue()" y="@YValue()" z="@Value(From)"/>
        <coord x="@XValue()" y="@YValue()" z="@Value(To)"/>
    </line>
</geometry>

Result:

0684Q00000ArLgqQAF.png

The way to find this is to use a Creator to create a sample geometry, for example a 3D line. 

0684Q00000ArLmnQAF.png

Then go to the XML tab to find the FME XML.

0684Q00000ArLmjQAF.png

Then replace the coordinates with placeholders.


takashi
Evangelist
  • December 13, 2019

Another thought, 3DForcer and Extruder could also be useful.


fikusas
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • December 13, 2019

All three methods work just fine. Thank you guys!


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