Maptitude GISDK Help |
Splits a line feature at a given coordinate.
new_ids = SplitLink(integer old_id, coordinate split_point, array options)
Argument |
Contents |
old_id |
The ID of the line to be split |
split_point |
The location at which the line should be split |
Option |
Type |
Contents |
Snap Node |
Boolean |
"True" if the new endpoint should be snapped to other line endpoints in the geographic file (overrides Snap To Shape Point option); "False" (the default) for no node snapping |
Snap To Shape Point |
Boolean |
"True" if the new endpoint should be snapped to a shape point of the link (the default); "False" to split the line at the click point |
Reason |
String |
If provided, a record will be added to the database's log file, with this used as the Reason column. If it's not provided, no entry will be added, even if the other options are present. |
Comment |
String |
Text for the comment field of the log file. |
User |
String |
User name for the log file. |
An array of three IDs: the two new line IDs and the ID of the node at the split (which is a new node, unless the Snap Node option is used).
SplitLink() can only be used on the line layer of a standard geographic file.
The line layer must be the current layer.
If split_point is not within the global snap distance of the line, SplitLink() does not perform a split and signals Error. If Error is not handled an error message indicates that the split_point is not within the global snap distance of the line and the process is terminated.
The log file name will have the same name as the database and a .txt extension.
// Add a line to a street file
SetLayer("Streets")
line_pt = ClickCoord()
pt = ClickCoord()
line_id = RH2ID(LocateNearestRecord(a_pt, 0.25))
ids = SplitLink(line_id, pt, null)
ShowMessage("There are " + String(ids.length - 1) + " new line features.")
Error Type |
Meaning |
Error |
The current layer is not a line layer, or is not from a standard geographic file, or the split_point is not within the snap distance of the line |
Function |
Summary |
Adds a line feature to a line layer |
|
Adds an endpoint to a standard geographic line file |
|
Deletes a line feature from a line layer |
|
Joins two line features that meet at a common endpoint |
©2025 Caliper Corporation | www.caliper.com |