Hi,
Have you tried snipper with vertex percentage 50-50 option along with coordinate extractor?
Not sure, but would the CoordinateExtractor with index 1 work?
Index 0 should be start and index 2 should be end point.
Hi,
Have you tried snipper with vertex percentage 50-50 option along with coordinate extractor?
That is unfortunately not exactly what I need. That would give me the point exact halfway of the arc. But I need the mid point that describes the form of the arc (see this
link under last section "ArcBy3Points"). They explain it, but do not tell, how they calculate it.
Not sure, but would the CoordinateExtractor with index 1 work?
Index 0 should be start and index 2 should be end point.
Thanks a lot! Unfortunately that doesn't work. With index 1, the coordinates are 0. For index 0 and -1 both the center point (from the ellipse) are calculated. I find it quite difficult to extract the geometry information (which obviously is somewhere, seen in the attached picture) into an attribute.. Maybe you know more about it?
Hi,
Have you tried snipper with vertex percentage 50-50 option along with coordinate extractor?
The exact halfway point is also a mid-point. What kind of "mid-point" do you need?
Please provide example to understand better
Hi Takashi. You are right. There are indeed many points describing an arc, also the one exact halfway. In the below example (highligthed in yellow and illustrated in the arc), it is not the midpoint exact halfway, but somewhere between start and end point. Somehow, fme gets this coordinate from the incoming data, but I cannot find, where to extract this information from the IFMEArc geometry. Is this at all possible?
Please provide example to understand better
Hi! Attached a screenshot of the problem. You see, the arc has a mid point, which is not exactly half way, but also given in the geometry. And I'd like to extract the coordinates of this red point ("Mid Point") to a new attribute. All I can extract with CoordinateConcatenator is Start, End and Center Point (the last one is the middle of the ellipse).
example-fme.png
Hi @schulthesskatha, if the arc was made of three points, a PythonCaller with this script extracts the coordinates of the mid-point. Otherwise, the method "getMidPoint()" returns interpolated half way point.
# PythonCaller Script Example
import fmeobjects
def extractMidPointOfArc(feature):
arc = feature.getGeometry()
if isinstance(arc, fmeobjects.FMEArc):
coord = arc.getMidPoint().getXYZ()
feature.setAttribute('_x', coord)0])
feature.setAttribute('_y', coordt1])
See the Python FME Objects API Reference (fmeobjects.FMEArc class) to learn more.
Hi @schulthesskatha, if the arc was made of three points, a PythonCaller with this script extracts the coordinates of the mid-point. Otherwise, the method "getMidPoint()" returns interpolated half way point.
# PythonCaller Script Example
import fmeobjects
def extractMidPointOfArc(feature):
arc = feature.getGeometry()
if isinstance(arc, fmeobjects.FMEArc):
coord = arc.getMidPoint().getXYZ()
feature.setAttribute('_x', coord)0])
feature.setAttribute('_y', coordt1])
See the Python FME Objects API Reference (fmeobjects.FMEArc class) to learn more.
Hi Takashi! It worked!! Thanks a lot, I'm very happy :)