This method merges road segments that belong to the same street.


Namespace: AspMap
Assembly: AspMapNET (in AspMapNET.dll)

Syntax

Visual Basic (Declaration)
Public Function MergeSegments( _ 
   ByVal fields As String _ 
) As Boolean
C#
public bool MergeSegments(
   string fields
)
C++
public:
 bool MergeSegments(
   String fields
) sealed 
J#
public bool MergeSegments(
   string fields
)
JScript
public  function MergeSegments(
   fields : String
) : bool

Parameters

fields
A semicolon-separated list of field names.

Return Value

The method returns True if segments merged successfully.

Remarks

The purpose of the MergeSegments method is to help you generate driving directions. The method takes a list of field names (from the shapefile associated with the road network) separated by semicolons and merges road segments belonging to the same street:

 Copy Code
route.MergeSegments("NAME;TYPE")

For example, the code above merges all consecutive road segments that contain "Main" as the street name (the NAME field) and "St" as the street type (the TYPE field) into a street with the "Main St" name. The following pictures demonstrate the effect of the MergeSegments method:

1. Road segments before merging

2. Merged road segments (streets)

After road segments are merged, you can access them as streets using the Streets property. The actual road segments remain unchanged.

See Also