Maptitude GISDK Help

MergeGeography()

Summary

Merges features from one layer into another.

 

Syntax

MergeGeography(string dest_layer, string source_layer_set, array options)

 

Argument Contents
dest_layer The layer into which features will be added
source_layer_set The layer or selection set whose features will be merged

 

Option Type Contents
Fields Array An array of field pairs ({source_field, dest_field}) whose values should be merged into the destination file; the fields must exist in both layers
Node Fields Array An array of field pairs ({source_field, dest_field}) whose values should be merged into the destination file; the fields must exist in both node layers; only appropriate for line layers
Snap Boolean "True" (the default) to snap together nodes when merging line databases, or "False" to prevent snapping
ID String, integer The string is "True" if you want to retain the original IDs from the source layer, or "False" (the default) otherwise. The integer represents the number to be added to the original IDs if the first value is "True." This option helps to maintain unique IDs in the merged file
Allow Duplicates Boolean "True" to allow duplicate points when merging point databases, or "False" (the default) to prevent duplicates

 

Notes

Example

// Before running the example, create a map by opening ri_hwy.cdf,

// export it to the standard geographic file mytemp.dbd and close it, then

// open mytemp.dbd and cthwy.cdf, all in the Tutorial folder.

MergeGeography("Highway", "Highways",

     {{"Fields", {{"[Route 1]", "[Route 1]"}, {"[Labels.CategoryName]", "[Labels.CategoryName]"}, {"Lanes", "Lanes"}}},

     {"Snap", "True"},

     {"ID", "True", 0}})

 

Error Codes

Error Type Meaning
Error The destination layer is not a point or line layer, or is not from a standard geographic file; the source_layer_set is not of the same type as the destination layer; or an option is invalid
NotFound The dest_layer or the source_layer_set does not exist. Or filenames not found

 

See Also

Function Summary
ComputeIntersectionPercentages() Intersects two or more area or line layers and computes the intersection percentages
ExportGeography() Converts a geographic file between standard and compact format, or creates a new geographic file from a selection set

 

 

©2025 Caliper Corporation www.caliper.com