Question

Pushing points and "dragging" snapped lines along with them

  • 26 September 2022
  • 4 replies
  • 6 views

Badge

Hello! I have a basic scenario where I need to batch move point features, while also dragging line features snapped those original points. The model is a network of split lines with a "station" at every line endpoint. We can assume every endpoint or intersection has a singular station. The sequence of lines and stations make up the backbone of the model. Maintaining that consistency is critical.

 

Now let's say I've received GPS data which places these points more accurately. A subset of stations now have fields for "Current XY" and "New XY". I need to physically push the points to the new location and this part is simple. Looks like I can use VertexCreator to reset their geometry. But I also need the line endpoints to automatically move with the station. Any thoughts on making this happen? Note that the stations and line endpoints generally have the same XY coordinates, but we assume a tiny spatial buffer is needed to catch everything.


4 replies

Userlevel 3
Badge +26

After moving your points to the desired location, I would use the AnchoredSnapper to move the line endpoints to the new point location. Points will be your Anchor input, and the lines will be your Candidate input. You will need to ensure the Snapping Type is End Point Snapping, and you will also need to experiment with the snapping tolerance.

Badge +2

@mlauer​ If you want to move your line in a more proportionate way you can use the AffineWarper or RubberSheeter.

Badge

Thank you for the replies. However, without going into too deep into details, I can't risk "fuzzy" snapping here. Lines don't simply need to snap to the nearest station, they need to snap to the SAME stations as they were originally, and in the same sequence. There is a lot of other data tied to these features.

 

I thought about it some more and came up with a workflow. . The key transformer I learned about is "VertexCreator". Despite the name, it can do a few tasks including replacing a specific vertex in a polyline. And we know geometry index [0] is the start point while [-1] is the end point. I can target those and compare them to station XYs.

 

Inputs:

  • Station features with NewX and NewY values, representing their destination locations. Used CoordinateExtractor to get the current geometry, called _StationX and _StationY. I need to push these stations in the map, but this also acts as a table of old and new XY locations. It will act as a guide for moving lines.
  • Polyline features snapped to those spans. Used CoordinateExtractor to get _StartX, _StartY, _EndX, _EndY.

Processing:

  • Round the six original geometries to 2 decimal places - _StationX/Y, _StartX/Y, _EndX/Y. This effectively acts as a spatial buffer. Rounding to 2 decimal places means the points are coincident as long as they are within 1/100th of a foot.
  • First I check the start point (Index 0) on lines. If any span start points match the original station location - meaning _StationX = _StartX and _Station_Y = _StartY - then I use VertexCreator to move [Index 0] to "NewX" and "NewY".
  • Then I check the end points [Index -1]. If _StationX = _EndX and _StationY = _EndY, I use VertexCreator to move [Index -1] to "NewX and "NewY.

Outputs:

  • Feature class of altered stations
  • Feature class of altered lines

 

It's a little easier to type out than to build, but I have a proof-of-concept workbench and it's working so far.

 

Userlevel 3
Badge +26

Thank you for the replies. However, without going into too deep into details, I can't risk "fuzzy" snapping here. Lines don't simply need to snap to the nearest station, they need to snap to the SAME stations as they were originally, and in the same sequence. There is a lot of other data tied to these features.

 

I thought about it some more and came up with a workflow. . The key transformer I learned about is "VertexCreator". Despite the name, it can do a few tasks including replacing a specific vertex in a polyline. And we know geometry index [0] is the start point while [-1] is the end point. I can target those and compare them to station XYs.

 

Inputs:

  • Station features with NewX and NewY values, representing their destination locations. Used CoordinateExtractor to get the current geometry, called _StationX and _StationY. I need to push these stations in the map, but this also acts as a table of old and new XY locations. It will act as a guide for moving lines.
  • Polyline features snapped to those spans. Used CoordinateExtractor to get _StartX, _StartY, _EndX, _EndY.

Processing:

  • Round the six original geometries to 2 decimal places - _StationX/Y, _StartX/Y, _EndX/Y. This effectively acts as a spatial buffer. Rounding to 2 decimal places means the points are coincident as long as they are within 1/100th of a foot.
  • First I check the start point (Index 0) on lines. If any span start points match the original station location - meaning _StationX = _StartX and _Station_Y = _StartY - then I use VertexCreator to move [Index 0] to "NewX" and "NewY".
  • Then I check the end points [Index -1]. If _StationX = _EndX and _StationY = _EndY, I use VertexCreator to move [Index -1] to "NewX and "NewY.

Outputs:

  • Feature class of altered stations
  • Feature class of altered lines

 

It's a little easier to type out than to build, but I have a proof-of-concept workbench and it's working so far.

 

@mlauer​ Sounds like you have a good solution. One thing to keep in mind is the Group Processing capabilities built into many transformers. For example, using the AnchoredSnapper, you could set the Group Processing to a unique identifier common between the points and lines. This would prevent unintentional snapping of lines to a point with different identifier. May not be applicable with your data, but something to be aware of.

Reply