Skip to main content
Question

How can I add elevation on arc without changing its structure?

  • March 17, 2019
  • 3 replies
  • 14 views

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

Hello,

I would like to add elevation values on arc without changing its structure.

Before, I have this arc

0684Q00000ArCgBQAV.png

And after I would like the arc to have this where the highlighted values should be the elevation values

0684Q00000ArCU6QAN.pngSO far my idea to do that is to use

arc =feature.getGeometry()                    
feat.setStartPoint(fmeobjects.FMEPoint(feat.getStartPoint().getXYZ()[0], feat.getStartPoint().getXYZ()[1], elevation_start))                      
feat.EndStartPoint(fmeobjects.FMEPoint(feat.getEndtPoint().getXYZ()[0], feat.getEndPoint().getXYZ()[1], elevation_end]))  

but it is not working.

Any hints?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

takashi
Celebrity
  • 7843 replies
  • March 18, 2019

If you need to convert an "Arc By Center Point" to an "Arc By Center Point With Ends", you can re-create required arc based on properties of the original arc using a constructor of fmboejcts.FMEArc with this signature. See the API documentation.

init(centerPoint, rotation, primaryRadius, secondaryRadius, startAngle, sweepAngle, startPoint, endPoint)

Creates an arc using the center point supplied, along with the supplied radii, angles, and points. All angles are CCW up from the horizontal, and are measured in degrees.

Parameters:    
centerPoint (FMEPoint) – The centerPoint of the arc.
rotation (float) – The rotation of the arc.
primaryRadius (float) – The primary radius of the arc.
secondaryRadius (float) – The secondary radius of the arc.
startAngle (float) – The start angle of the arc.
sweepAngle (float) – The sweep angle of the arc.
startPoint (FMEPoint) – (Optional) The start point of the arc.
endPoint (FMEPoint) – (Optional) The end point of the arc.
Return type:    
FMEArc

Returns:    
An instance of an Arc Geometry object.

e.g.

import fmeobjects
def processFeature(feature):
    arc = feature.getGeometry()
    newArc = fmeobjects.FMEArc(
        arc.getCenterPoint(),
        arc.getRotation(),
        arc.getPrimaryRadius(),
        arc.getSecondaryRadius(),
        arc.getStartAngle(),
        arc.getSweepAngle(),
        arc.getStartPoint(),
        arc.getEndPoint()
    )
    feature.setGeometry(newArc)

 


takashi
Celebrity
  • 7843 replies
  • March 18, 2019

If you need to convert an "Arc By Center Point" to an "Arc By Center Point With Ends", you can re-create required arc based on properties of the original arc using a constructor of fmboejcts.FMEArc with this signature. See the API documentation.

init(centerPoint, rotation, primaryRadius, secondaryRadius, startAngle, sweepAngle, startPoint, endPoint)

Creates an arc using the center point supplied, along with the supplied radii, angles, and points. All angles are CCW up from the horizontal, and are measured in degrees.

Parameters:    
centerPoint (FMEPoint) – The centerPoint of the arc.
rotation (float) – The rotation of the arc.
primaryRadius (float) – The primary radius of the arc.
secondaryRadius (float) – The secondary radius of the arc.
startAngle (float) – The start angle of the arc.
sweepAngle (float) – The sweep angle of the arc.
startPoint (FMEPoint) – (Optional) The start point of the arc.
endPoint (FMEPoint) – (Optional) The end point of the arc.
Return type:    
FMEArc

Returns:    
An instance of an Arc Geometry object.

e.g.

import fmeobjects
def processFeature(feature):
    arc = feature.getGeometry()
    newArc = fmeobjects.FMEArc(
        arc.getCenterPoint(),
        arc.getRotation(),
        arc.getPrimaryRadius(),
        arc.getSecondaryRadius(),
        arc.getStartAngle(),
        arc.getSweepAngle(),
        arc.getStartPoint(),
        arc.getEndPoint()
    )
    feature.setGeometry(newArc)

 

This script is also possible, if you just need to set z-coordinate to start and end points.

def processFeature(feature):
    elevation_start = 100
    elevation_end = 200
    arc = feature.getGeometry()
    p0 = arc.getStartPoint()
    p1 = arc.getEndPoint()
    p0.setZ(elevation_start)
    p1.setZ(elevation_end)
    arc.setStartPoint(p0)
    arc.setEndPoint(p1)
    feature.setGeometry(arc)

arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 101 replies
  • March 19, 2019

This script is also possible, if you just need to set z-coordinate to start and end points.

def processFeature(feature):
    elevation_start = 100
    elevation_end = 200
    arc = feature.getGeometry()
    p0 = arc.getStartPoint()
    p1 = arc.getEndPoint()
    p0.setZ(elevation_start)
    p1.setZ(elevation_end)
    arc.setStartPoint(p0)
    arc.setEndPoint(p1)
    feature.setGeometry(arc)

Thanks @takashi