Welcome to the L3 Harris Geospatial documentation center. Here you will find reference guides and help documents.
﻿
>  Docs Center  >  Libraries  >  Coyote  >  CGSETUNION

### CGSETUNION

CGSETUNION
This function is used to find the union between two sets of integers.
One alternative for the cgSetUnion algorithm, provided by Maarten Sneep, is simply this::
superset = [set_a, set_b]
union = superset[Uniq(superset, Sort(superset))]

Utilities

## Returns

A vector of values that are found in the combined integer sets.

## Params

set_a: in, required, type=integer
A vector of integers.
set_b: in, required, type=integer
A vector of integers.

## Keywords

count: out, optional, type=long
Set this keyword to a named variable containing the number of integers found in the union.

## Examples

IDL> set_a = [1,2,3,4,5]
IDL> set_b = [4,5,6,7,8,9,10,11]
IDL> Print, cgSetUnion(set_a, set_b)
1 2 3 4 5 6 7 8 9 10 11
See http://www.idlcoyote.com/tips/set_operations.html for other types of set operations.

## Author

FANNING SOFTWARE CONSULTING::
David W. Fanning
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: david@idlcoyote.com
Coyote's Guide to IDL Programming: http://www.idlcoyote.com

## History

Change History::
Written by: David W. Fanning, November 25, 2009, from code originally supplied to the IDL
newsgroup by Research Systems software engineers.
Added COUNT keyword. 24 April 2014. DWF.