I am snapping points to line based on unique id (using group by). I tried using both vertex snapping or segment snapping. In both of these case, the points are being snapped to endpoints in some cases ( as per screenshot). I don't want to snap the point to endpoint at all, but it can be anywhere on the line. How to achieve snapping the point on the line other than endpoint of the line? Thank you
In the situation you marked in red, the end point is the nearest location on the line to the original point.
Like @geomancer says, snapping only works on vertices, not the lines in between. You can use a Densifier to add additional vertexes and then either generalize them again afterwards (though that may result in slightly altered geometries) but a better option may be to use a GeometryExtractor to save the original geometry of the anchor features, then Densifier, AnchoredSnapper, GeometryReplacer to bring the original anchors back and Intersector to create a new vertex on the intersection point.
Thanks @Hans van der Maarel @geomancer for sharing knowledge.
It looks expensive on what I am trying to achieve... I am trying to get the count of points on the line. As this highlighted point is at the endpoint of three lines, when I do a spatial relator transformer, this point will calculated on the count for all the three lines which is ideally right, but I would like the point to be considered just on one line (that is running horizontally). This is the reason I wanted to move the point on the line (OK to have a new vertex), but this seems to be complicated and runtime may increase considering the volume. If this is the only approach, then will use the above approach.
The horizontal line and the highlighted point has a common attribute value. Can we use some filter transformer to find out the count based on the mixture of common attribute value and spatial relator ? Just checking if there is a different way to achieve this...Thanks
Sorry for the long post...still novice with FME and learning...Thanks
Hi @naveen, thanks for the feedback.
If I understand correctly, you want to know the number of points with a common Line-ID, and add that number to the line. There is no need to project the points on the lines to accomplish this, this can be done using the attributes only.
There are many ways to do this, but I think the clearest way is to count the number of points with the same Line-ID in a StatisticsCalculator (use the Line-ID in Group By), and add those statistics to the lines with a FeatureMerger (or a FeatureJoiner).
Hi @naveen, thanks for the feedback.
If I understand correctly, you want to know the number of points with a common Line-ID, and add that number to the line. There is no need to project the points on the lines to accomplish this, this can be done using the attributes only.
There are many ways to do this, but I think the clearest way is to count the number of points with the same Line-ID in a StatisticsCalculator (use the Line-ID in Group By), and add those statistics to the lines with a FeatureMerger (or a FeatureJoiner).
This worked @geomancer Thanks so much
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.