In my workspace I am using the CenterOfGravityReplaces and/or the CenterPointReplacer transformer but some of my points do not actually land on the line. Some do. How can I get it so that all of the midpoints land on the lines?
In my workspace I am using the CenterOfGravityReplaces and/or the CenterPointReplacer transformer but some of my points do not actually land on the line. Some do. How can I get it so that all of the midpoints land on the lines?
Make a network of it, that is, all lines are defined between nodes.
The use a snipper in percentage mode on these linepieces. Start = 50, End = 50 will result in middle of linepiece.
I'm trying to do the same thing. We currently do this with ArcInfo. See:
http://pro.arcgis.com/en/pro-app/tool-reference/data-management/feature-to-point.htm
"If the Inside option on the dialog box is checked (the point_location parameter is set to INSIDE), the location of the representative point of an input feature will be contained by the input feature and determined as follows:
For an input line: the output point will be on the line. If the line is a parametric (true) curve, the output point will be at the midpoint of the line."
I'm trying to replicate this in FME by using the Snipper to trim 50% from the start and end of the line, resulting in a point feature. See:
It works for some lines but we have others where the line branches (dark grey in screenshot below) or is a multipart feature where the parts are geographically separate (light grey in screenshot).
This results in more than one point coming out of Snipper. The yellow points are what the ArcGIS tool creates, the pink are what Snipper produces. There's obviously a certain advantage in a blob appearing on each of the light grey lines, but we specifically only want one point per feature.
I'm trying to do the same thing. We currently do this with ArcInfo. See:
http://pro.arcgis.com/en/pro-app/tool-reference/data-management/feature-to-point.htm
"If the Inside option on the dialog box is checked (the point_location parameter is set to INSIDE), the location of the representative point of an input feature will be contained by the input feature and determined as follows:
For an input line: the output point will be on the line. If the line is a parametric (true) curve, the output point will be at the midpoint of the line."
I'm trying to replicate this in FME by using the Snipper to trim 50% from the start and end of the line, resulting in a point feature. See:
It works for some lines but we have others where the line branches (dark grey in screenshot below) or is a multipart feature where the parts are geographically separate (light grey in screenshot).
This results in more than one point coming out of Snipper. The yellow points are what the ArcGIS tool creates, the pink are what Snipper produces. There's obviously a certain advantage in a blob appearing on each of the light grey lines, but we specifically only want one point per feature.
Hi @tim_wood, I'm not sure whether it's the correct behavior that the Snipper with your setting generates multiple points for every part of a so-called multi-part line. I thought the Snipper should reject a feature having an Aggregate or Multi geometry according to this description in the help doc.
"Aggregate features, including homogeneous aggregates, are also rejected." -- Help on the Snipper
Or, if the behavior is intentional, the help doc has to be modified. Hope someone from Safe check this. @NatalieAtSafe
Anyway, "midpoint" cannot be defined for a multi-part line, and your quoted Esri description on the "Feature To Point" functionality doesn't mention the definition of the INSIDE point of a multi-part line. You therefore will have to clarify the definition of your desired point for a multi-part line at first. Since the logic of the Esri function is not published, "a point which is the same as the point created by the Esri Feature To Point function" defines nothing.
Just an example. If you need to create "a point on a multi-part line, which is closest to the center of gravity of the source multi-part line", it could be created by a small workflow consisting of a CanterPointReplacer (Mode: Center of Gravity Point), a NeighborFinder, and a VertexCreator.
Hi @tim_wood, I'm not sure whether it's the correct behavior that the Snipper with your setting generates multiple points for every part of a so-called multi-part line. I thought the Snipper should reject a feature having an Aggregate or Multi geometry according to this description in the help doc.
"Aggregate features, including homogeneous aggregates, are also rejected." -- Help on the Snipper
Or, if the behavior is intentional, the help doc has to be modified. Hope someone from Safe check this. @NatalieAtSafe
Anyway, "midpoint" cannot be defined for a multi-part line, and your quoted Esri description on the "Feature To Point" functionality doesn't mention the definition of the INSIDE point of a multi-part line. You therefore will have to clarify the definition of your desired point for a multi-part line at first. Since the logic of the Esri function is not published, "a point which is the same as the point created by the Esri Feature To Point function" defines nothing.
Just an example. If you need to create "a point on a multi-part line, which is closest to the center of gravity of the source multi-part line", it could be created by a small workflow consisting of a CanterPointReplacer (Mode: Center of Gravity Point), a NeighborFinder, and a VertexCreator.
In 2017.0.1.1, the Snipper has an Agggregate Handling option, which can be set to Deaggregate or Reject. I think this may be missing from the help page for the transformer @NatalieAtSafe.
In 2017.0.1.1, the Snipper has an Agggregate Handling option, which can be set to Deaggregate or Reject. I think this may be missing from the help page for the transformer @NatalieAtSafe.
Hi @tim_wood, I'm not sure whether it's the correct behavior that the Snipper with your setting generates multiple points for every part of a so-called multi-part line. I thought the Snipper should reject a feature having an Aggregate or Multi geometry according to this description in the help doc.
"Aggregate features, including homogeneous aggregates, are also rejected." -- Help on the Snipper
Or, if the behavior is intentional, the help doc has to be modified. Hope someone from Safe check this. @NatalieAtSafe
Anyway, "midpoint" cannot be defined for a multi-part line, and your quoted Esri description on the "Feature To Point" functionality doesn't mention the definition of the INSIDE point of a multi-part line. You therefore will have to clarify the definition of your desired point for a multi-part line at first. Since the logic of the Esri function is not published, "a point which is the same as the point created by the Esri Feature To Point function" defines nothing.
Just an example. If you need to create "a point on a multi-part line, which is closest to the center of gravity of the source multi-part line", it could be created by a small workflow consisting of a CanterPointReplacer (Mode: Center of Gravity Point), a NeighborFinder, and a VertexCreator.
However, this might be better.
Hi
You can use the labelpointreplacer , coordinateextractor, vertexcreator (replace with point mode witj the xvalue and y value from the coordinateextractor)
Hi @tim_wood, I'm not sure whether it's the correct behavior that the Snipper with your setting generates multiple points for every part of a so-called multi-part line. I thought the Snipper should reject a feature having an Aggregate or Multi geometry according to this description in the help doc.
"Aggregate features, including homogeneous aggregates, are also rejected." -- Help on the Snipper
Or, if the behavior is intentional, the help doc has to be modified. Hope someone from Safe check this. @NatalieAtSafe
Anyway, "midpoint" cannot be defined for a multi-part line, and your quoted Esri description on the "Feature To Point" functionality doesn't mention the definition of the INSIDE point of a multi-part line. You therefore will have to clarify the definition of your desired point for a multi-part line at first. Since the logic of the Esri function is not published, "a point which is the same as the point created by the Esri Feature To Point function" defines nothing.
Just an example. If you need to create "a point on a multi-part line, which is closest to the center of gravity of the source multi-part line", it could be created by a small workflow consisting of a CanterPointReplacer (Mode: Center of Gravity Point), a NeighborFinder, and a VertexCreator.
Hi
You can use the labelpointreplacer , coordinateextractor, vertexcreator (replace with point mode witj the xvalue and y value from the coordinateextractor)
I liked the sound of this idea but unless I run the features through GeometryFilter (Line port) or GeometryValidator (all come out of Passed port), LabelPointReplacer rejects what seems like the first feature as having and invalid geometry type. Inspecting the feature, it's an fme_aggregate made up of 2 lines so I wonder if LabelPointReplace doesn't like multipart features. I wonder what GeometryValidator and GeometryFilter do to the data because 20,000 input features come out the Passed/Line ports and become 68,000 features after LabelPointReplacer, and I get the green points shown below.
Hi @hlee1282
CenterPointReplacer uses feature bounding box or center of mass, i.e. it does not guarantee that the 'center point' will be on the line.
You might want to give LineDivider (custom transformer developed by @takashi ) a try.
Thanks for all the suggestions, I had the same problem, and used the simple solution of reader - snipper - writer. In snipper, using exact parameter noted above, sipping mode: distance percentage, starting location and ending location both 50.
Worked like a charm, thanks!