Is there a way to smooth a line so the resulting line passes through all the original vertices?
Have you looked at any of the smoothing algorithms in the Generalizer transformer?
Have you looked at any of the smoothing algorithms in the Generalizer transformer?
NURBfit produces a nice looking line but it looks like it goes tangentially through the mid-point of the original line segments.
NURBfit produces a nice looking line but it looks like it goes tangentially through the mid-point of the original line segments.
Simplifying a line always means you loose vertices, no?. Are these lines arcs? Or simple polylines?
Simplifying a line always means you loose vertices, no?. Are these lines arcs? Or simple polylines?
My input is polylines.
The algorithms of the Generalizer transformer are the proper way as david_r suggested.
Another way is to remove vertices by a combination of the VertexCounter and VertexRemover transformers.
If you want to develop your own smoothing algorithm, you can make use of the Python FME API inside a PythonCaller transformer.
Based on your feedback, I'm starting to think that there's no current transformer in FME that can smooth a polyline while preserving the vertices.
However, it should be fairly simple to implement in Python, see this example:
https://stackoverflow.com/a/14348309
Maybe the scipy.interpolate.spline() drawn in red is approaching what you want? (Hint: scipy.interpolate is already installed in the Python interpreter that comes with ArcGIS)
If you do end up implementing this, it would me much appreciated if you would share it through the FME Hub :-)
Hi @btl, It does look like we don't currently have a way to do this in FME, unless you can try david_r's python approach. So I made a suggestion on our Idea page, on your behalf. Can you please add any additional thoughts or use cases in there, and give it an up vote? We will take the popularity of these ideas into consideration, when they plan future development. :)
Based on your feedback, I'm starting to think that there's no current transformer in FME that can smooth a polyline while preserving the vertices.
However, it should be fairly simple to implement in Python, see this example:
https://stackoverflow.com/a/14348309
Maybe the scipy.interpolate.spline() drawn in red is approaching what you want? (Hint: scipy.interpolate is already installed in the Python interpreter that comes with ArcGIS)
If you do end up implementing this, it would me much appreciated if you would share it through the FME Hub :-)
Thanks.
Thanks.
Hi @btl, It does look like we don't currently have a way to do this in FME, unless you can try david_r's python approach. So I made a suggestion on our Idea page, on your behalf. Can you please add any additional thoughts or use cases in there, and give it an up vote? We will take the popularity of these ideas into consideration, when they plan future development. :)