Maptitude GISDK Help |
Merges features from one layer into another.
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 |
Only point or line layers can be merged.
Both layers must be in a map and they must be of the same geographic type, i.e., point with point or line with line.
The target geographic file must be a standard format file.
If using the ID option, makes IDs from the source database more identifiable by adding a large number. This is especially useful if merging databases of similar but distinct type, such as bus stations and train stations.
When using the Fields option, make sure field names with special characters are enclosed in brackets. See 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 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 |
Function |
Summary |
Intersects two or more area or line layers and computes the intersection percentages |
|
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 |