Maptitude GISDK Help

SplitLink()

Summary

Splits a line feature at a given coordinate.

 

Syntax

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.

 

Returns

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).

 

Notes

Example

// Add a line to a street file

SetLayer("Street")

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 Codes

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

 

See Also

Function Summary
AddLink() Adds a line feature to a line layer
AddNode() Adds an endpoint to a standard geographic line file
DeleteLink() Deletes a line feature from a line layer
JoinLinks() Joins two line features that meet at a common endpoint

 

 

©2025 Caliper Corporation www.caliper.com