Merging Nodes in Close Proximity

Applies To
Product(s): WaterCAD, WaterGEMS, HAMMER, SewerGEMS, SewerCAD, StormCAD, CivilStorm
Version(s): CONNECT Edition, V8i
Area: Layout and Data Input
Original Author: Mark Pachlhofer, Bentley Technical Support Group



How can I merge together multiple nodes in close proximity, to clean up extra information after importing data from ModelBuilder? can this be done in bulk/batch?


The issue with having extra junctions in close proximity typically stems from the way that the model's source data is set up.

If the model was built from shapefiles or CAD files then you may want to check that your polylines all end at points and everything was created using the snapping feature. If possible, convert multiple lines in series into a single polyline where appropriate.

You can also clean up these artifacts after building the model, using the Merge Nodes in Close Proximity feature. To use it, right click on the element that you want to keep, choose "Merge Nodes in Close Proximity", then enter the appropriate tolerance. This requires some judgment but generally you want it large enough to capture the nearby nodes that you wish to merge together, but not too large so as not to accidentally merge in nodes that should not be.

Note on demands and loads: as of version, demands/loads are not retained for nodes that are removed during a “merge nodes in close proximity” operation (reference #906295) Also, if a customer meter is associated with a removed Junction, it doesn’t get reassigned to the retained junction. This feature is mainly intended for model clean-up after an initial import from ModelBuilder. Source data often includes extra information resulting in extra nodes that a user may want to remove before proceeding to other steps such as assigning elevations and demands/loads. If the demand or load information was imported via LoadBuilder, a possible workaround would be to re-assign them from the same source shapefile in loadBuilder after the merge-nodes operation, choosing a selection set of the node(s) that remained after the merge-nodes operation. If you are trying to use this feature to reduce the number of pipes in your model, it may be better to utilize one or more different types of operations in Skelebrator.





Batch merging nodes in close proximity (multiple areas)

In some cases, you may have many areas in your model that need to have multiple nodes in close proximity merged. Consider these options: 

Method 1

Start over and re-run ModelBuilder with the "Tolerance" in the option "Establish Connectivity Using Spatial Data" bigger than what you used before.  This should more successfully snap pipe ends together than the previous import, but may now cause other problems such as pipes snapping to other pipes they should not snap to. 

Method 2

Clean up the geometry in the source file (using an application like ArcGIS), then start over and re-importing with ModelBuilder. See: Preparing GIS data for use in the hydraulics and hydrology products

Method 3

Similar to Method 1, but with finer user control.

1. Run Network Navigator, and open the query for Nodes in Close Proximity. The tolerance is up to you, but is a balance between being able to pick up the majority of nodes that need to be merged, and making sure you don't inadvertently pick up nodes that shouldn't be merged. 

2. Save the results as Selection Set by right clicking in the drawing and choosing to create a selection set.

3. Optional, but for better results, manually review the Network Navigator Results/Selection Set and Add/Remove nodes from the selection as necessary.

4. With the final selection you are happy with, use View > Network Navigator > Find Adjacent Links 

5. Right Click in the drawing and select Edit Group, then open the Pipe FlexTable 

6.  Export these Pipes to Shapefile from the button in the top-left corner of the FlexTable

7. Re-select the Final Selection Set of Junctions. Right Click in the Drawing and choose Edit Group, then open the Junction FlexTable 

8. In the FlexTable, add in the X Coordinate attribute (if it isn't there already). Global Edit it, and set it as something unique (like 0). The purpose of this is to move these junctions far away from the junctions you actually want the pipes to connect to. 

9. Setup a new ModelBuilder operation to re-import these Pipes. You don't need to import any of the attributes, just the geometry, so don't bother with setting attributes again. The key is to use trial and error with the "Tolerance" value for the "Establish connectivity using Spatial Data" setting. You'll need to set this to a larger value than what you used in the first import, but you don't want it too large otherwise you may start having pipes re-connect to other Junctions that you don't want them to be connected to. 

Consider leaving the "Create nodes if none found at endpoint" option off, at least initially. You want to force the pipes to re-connect to Junctions already in the model, not create new junctions. You could run one ModelBuilder operation, review the results (say with most, but not all pipes successfully re-connecting), and run subsequent ModelBuilder operations with increased "Tolerance" values to pick up the rest of the pipes not yet re-connected. 

10.  The ModelBuilder operations(s) should re-snap these pipes. Any that did not, you can re-connect manually. 

11.  You may now be left with many junctions orphaned (with an X Coordinate of 0).  Use Network Navigator->Orphaned Nodes to select, and delete them from model (no longer required).  Make sure none of these junctions get left behind. 

12.  Finally, go to File > Database Utilities > Update Database Cache (in V8i, go to Tools > Database Utilities > Update Database Cache). This will reset your drawing extents back to what they should be.

See Also

Importing external data using ModelBuilder - Building and Updating

Using Network Navigator